Buttons on every row in a grid
I made a simple data grid and want to place an edit
button on every rows last cell. Is this possible?
To make it tricky for you: we are using the "smarty" template system.
Details:
{foreach name=todo from=$todo item=todoItem}
grid.addRow({$todoItem.id});
grid.setCellText(["{$todoItem.id}",
"Cell1 value",
"Cell2 value",
...
"<span id='cmdEdit{$todoItem.id}'></span>"
{$todoItem.id});
{/foreach}
{foreach name=todo from=$todo item=todoItem}
var cmdEdit{$todoItem.id} = new AW.UI.Button;
cmdEdit{$todoItem.id}.setId("cmdEdit{$todoItem.id}");
cmdEdit{$todoItem.id}.setControlText("Edit");
cmdEdit{$todoItem.id}.setControlImage("Edit");
cmdEdit{$todoItem.id}.refresh();
{/foreach}
Any hints?
Tilmann
button on every rows last cell. Is this possible?
To make it tricky for you: we are using the "smarty" template system.
Details:
{foreach name=todo from=$todo item=todoItem}
grid.addRow({$todoItem.id});
grid.setCellText(["{$todoItem.id}",
"Cell1 value",
"Cell2 value",
...
"<span id='cmdEdit{$todoItem.id}'></span>"
{$todoItem.id});
{/foreach}
{foreach name=todo from=$todo item=todoItem}
var cmdEdit{$todoItem.id} = new AW.UI.Button;
cmdEdit{$todoItem.id}.setId("cmdEdit{$todoItem.id}");
cmdEdit{$todoItem.id}.setControlText("Edit");
cmdEdit{$todoItem.id}.setControlImage("Edit");
cmdEdit{$todoItem.id}.refresh();
{/foreach}
Any hints?
Tilmann
Tilmann Starke (Softwork Germany)
May 3,