View Full Version : Add additional parameter to Grid.Command event

Aug 17, 2009, 2:39 PM
Currently, the Grid.Command event exposes the command, record, and rowIndex. Is it possible to add an additional parameter for the actual item (menu, button, etc) clicked? For example, on an item click, I want to change the grid command icon.

Here's a sample use case:
1. Each grid row shows a project (name, description, status).
2. Status is a CommandColumn with a menu. The menu items are Mark Approved, Mark Complete, etc.
3. On menu item click, I want to change the icon of the grid command to reflect the new status.

If the Command event exposes the button clicked, I can get the iconCls of the button and set its' parent's parent's icon to it.

Aug 17, 2009, 3:16 PM
It would be great if it can pass the toolbar object too =P

Aug 18, 2009, 5:56 AM

I don't think that it is a good idea because after each sorting/cell editing/data rebinding the row (or grid) will be refreshed (it is mean rerendering). Toolbar which used in CommandColumn will be recreated. In this case you will loose all changes that were made outise 'prepare' function.

I recomend apply all changes in 'prepare' functions. When you need to update commands UI for particular row then call the following code



Aug 18, 2009, 10:56 AM
Thanks for the suggestion. The grid refresh row worked for me.