tags:

views:

52

answers:

1

hi,

I search an issue to up/down row with buttons. I m trying to use 'grid.getCurrentCell' but when i click button currentCell is not yet define.

How can i do this ?

Thanks.

(sorry for my poor english)

A: 

You can probably do this using the ID of your row. When you create the row, set the button to <a onclick='moveUp(23)'><img src='up.gif'></a>

Where 23 is the index in your data. You could also update this by calling:

for(var i in data)
  data[i]['upButtonColumn']="<a onclick='moveUp("+i+")'><img src='up.gif'></a>";
grid.removeRows(rows);
grid.render(); 

Or something similar, but that would be slower.

Magneon