PDA

View Full Version : grid onrowclick



Bogdan0x400
16 Feb 2011, 1:30 AM
I need to display/hide some controls depending on the currently selected row in the editorgrid. The cell in the current row must be of specific value. What events should I use for that? I mean the row can be added and then the cell could be set to a specific value, or it can be deleted, or a row with specific cell value can be selected. Looks like plenty of situations.

tobiu
16 Feb 2011, 1:42 AM
rowclick : ( Grid this, Number rowIndex, Ext.EventObject e )
Fires when a row is clicked
Listeners will be called with the following arguments:
this : Grid
rowIndex : Number
e : Ext.EventObject

is just fine. with grid.getStore() you have the store and with the index you get the record of the row.
now just look record.get('myField') for the right value.


best regards
tobiu

Bogdan0x400
16 Feb 2011, 1:58 AM
What about the cases when the row isn't clicked? Like the current row being edited.

tobiu
16 Feb 2011, 3:27 AM
EditorGridPanel -> afteredit

Store -> update

are 2 events that should fit. take a closer look at the API-docs.

Bogdan0x400
16 Feb 2011, 6:27 AM
Thanks a lot, tobiu!