Need some table help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Need some table help

jWarrior
I am a relative Seaside newbie. I am trying to get up to speed by
writing a small app to support our football club.

I have a table of game data. Each row has

game# time homeTeam awayTeam currentPick

What i want to do is add a combo box as the sixth element in the table
row which would have two selections: the homeTeam and the awayTeam.
After selecting a pick, I want to update the row to show the new value
for aWvPick currentPick, the fifth element.

I have googled my brains out looking for an example and  have grepped
the last 3 years of the archives, but no joy so far. My table looks like
this:

     html tableRow: [
         html tableData: aWvPick gameNumber.
         html tableData: aWvPick time.
         html tableData: aWvPick home.
         html tableData: aWvPick away.
         html tableData: aWvPick currentPick"show the current pick here"

"want to put combo box here"].

Thanks in advance.

--
Donald [|]

This is a job for BOB VIOLENCE and SCUM, the INCREDIBLY STUPID MUTANT DOG.
                -- Bob Violence


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Need some table help

Esteban A. Maringolo
You can do some ajax replacement there, replacing the whole row every
time you change the selection.


Below some untested code that should lead you in the right direction.

renderRowOn: html

html tableRow
  id: (rowId := html nextId);
  with: [
    self renderCellsRowId: rowId on: html
]


renderCellsRowId: rowId on: html
   html tableData: aWvPick gameNumber.
   html tableData: aWvPick time.
   html tableData: aWvPick home.
   html tableData: aWvPick away.
   html tableData: aWvPick currentPick"show the current pick here"
   html tableData: [
       html select
          "... select options and configs "
           onClick: (
            (html jQuery ajax
                callback: ["whatever you do when the select changes"]
value: ("what you chose as value");
                onSuccess: (html jQuery id: rowId) load: [:h | self
renderCellsRowId: rowId on: h ])
          )
   ]


Esteban A. Maringolo


2017-07-14 12:32 GMT-03:00 Donald MacQueen <[hidden email]>:

> I am a relative Seaside newbie. I am trying to get up to speed by writing a
> small app to support our football club.
>
> I have a table of game data. Each row has
>
> game# time homeTeam awayTeam currentPick
>
> What i want to do is add a combo box as the sixth element in the table row
> which would have two selections: the homeTeam and the awayTeam. After
> selecting a pick, I want to update the row to show the new value for aWvPick
> currentPick, the fifth element.
>
> I have googled my brains out looking for an example and  have grepped the
> last 3 years of the archives, but no joy so far. My table looks like this:
>
>     html tableRow: [
>         html tableData: aWvPick gameNumber.
>         html tableData: aWvPick time.
>         html tableData: aWvPick home.
>         html tableData: aWvPick away.
>         html tableData: aWvPick currentPick"show the current pick here"
>
> "want to put combo box here"].
>
> Thanks in advance.
>
> --
> Donald [|]
>
> This is a job for BOB VIOLENCE and SCUM, the INCREDIBLY STUPID MUTANT DOG.
>                 -- Bob Violence
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Need some table help

Esteban A. Maringolo
I daWvPick should be a parameter for renderRowOn:

so...
renderRowFor: aWvPick on: html
calls:
renderCellsFor: aWvPick rowId: rowId on: html


But the concept is the same.


Esteban A. Maringolo


2017-07-14 14:00 GMT-03:00 Esteban A. Maringolo <[hidden email]>:

> You can do some ajax replacement there, replacing the whole row every
> time you change the selection.
>
>
> Below some untested code that should lead you in the right direction.
>
> renderRowOn: html
>
> html tableRow
>   id: (rowId := html nextId);
>   with: [
>     self renderCellsRowId: rowId on: html
> ]
>
>
> renderCellsRowId: rowId on: html
>    html tableData: aWvPick gameNumber.
>    html tableData: aWvPick time.
>    html tableData: aWvPick home.
>    html tableData: aWvPick away.
>    html tableData: aWvPick currentPick"show the current pick here"
>    html tableData: [
>        html select
>           "... select options and configs "
>            onClick: (
>             (html jQuery ajax
>                 callback: ["whatever you do when the select changes"]
> value: ("what you chose as value");
>                 onSuccess: (html jQuery id: rowId) load: [:h | self
> renderCellsRowId: rowId on: h ])
>           )
>    ]
>
>
> Esteban A. Maringolo
>
>
> 2017-07-14 12:32 GMT-03:00 Donald MacQueen <[hidden email]>:
>> I am a relative Seaside newbie. I am trying to get up to speed by writing a
>> small app to support our football club.
>>
>> I have a table of game data. Each row has
>>
>> game# time homeTeam awayTeam currentPick
>>
>> What i want to do is add a combo box as the sixth element in the table row
>> which would have two selections: the homeTeam and the awayTeam. After
>> selecting a pick, I want to update the row to show the new value for aWvPick
>> currentPick, the fifth element.
>>
>> I have googled my brains out looking for an example and  have grepped the
>> last 3 years of the archives, but no joy so far. My table looks like this:
>>
>>     html tableRow: [
>>         html tableData: aWvPick gameNumber.
>>         html tableData: aWvPick time.
>>         html tableData: aWvPick home.
>>         html tableData: aWvPick away.
>>         html tableData: aWvPick currentPick"show the current pick here"
>>
>> "want to put combo box here"].
>>
>> Thanks in advance.
>>
>> --
>> Donald [|]
>>
>> This is a job for BOB VIOLENCE and SCUM, the INCREDIBLY STUPID MUTANT DOG.
>>                 -- Bob Violence
>>
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Need some table help

Stephan Eggermont-3
In reply to this post by jWarrior
On 14/07/17 17:32, Donald MacQueen wrote:
> I am a relative Seaside newbie. I am trying to get up to speed by
> writing a small app to support our football club.

You might find
http://seaside.gemtalksystems.com/tutorial.html
useful

Stephan Eggermont


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside