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.

{foreach name=todo from=$todo item=todoItem}
"Cell1 value",
"Cell2 value",
"<span id='cmdEdit{$todoItem.id}'></span>"


{foreach name=todo from=$todo item=todoItem}
var cmdEdit{$todoItem.id} = new AW.UI.Button;

Any hints?

Tilmann Starke (Softwork Germany)
May 3,
Sorry, I don't have any experience with Smarty. Your code looks reasonable, does it actually work like that?
Alex (ActiveWidgets)
May 4,

I use smarty a lot and on a quick glance at your template, it looks fine.
If you are having problems, here are a few tips that I use when working with smarty:

1) Try adding {debug} to the top of your smarty template. This will give you a popup window with all the variables and their values that have been passed to the template. This is to figure out if your php script is sending an incorrect value or you are using it incorrectly in the template.

2) In FireFox, use Tools > Error Console to catch obvious javascript errors, or better still, install the FireBug extension (http://www.getfirebug.com/). When using smarty variables in javascript, I often end up making simple mistakes that cause a javascript syntax error.

3) Finally, view source of the page to ensure your template is producing the code you want it to produce.

If you are still having problems after that, can you post a sample php script that calls the template ? I can try it out and see if I catch anything.

PS: Is the array given as parameter to grid.setCellText() closed properly ? That is, does the [ have a matching ] in your template ?
Ankur Motreja
May 4,
Alex and Ankur,

Thanks for respond.
I will try out some more and give you
information about the results.


Tilmann Starke
May 7,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.