PDA

View Full Version : rowselect event?



bendy
30 Mar 2007, 12:21 PM
I need to have a function fire when a row is selected. Currently I am doing this:


this.resultsGrid.on("rowclick", this.loadVehicle, this);

Which works fine when clicking on a row. However, selecting a row by using the up/down errors does not fire the event. Is there a way to do this other than handing the raw keydown event? It seems like a "rowselect" event would be more usefull than just the rowclick event. Any ideas?

tryanDLS
30 Mar 2007, 12:29 PM
RowSelection is delegated to the selectionModel, so you can do.


this.resultsGrid.getSelectionModel().on('rowselect', function() { alert('select');});


There are also events for beforerowselect, rowdeselect, selectionchange. See the doc in RowSelectionModel.js for parm info.

bendy
30 Mar 2007, 12:31 PM
Great! Can't believe I didn't look there. :oops:

Thanks for the help!