PDA

View Full Version : How to get the data of a selected Row?



next2you
13 Sep 2006, 11:29 AM
Hi,

I like to get the data from a selected row to update it. From the grid (or the default selection model) I can get the HTML element (the selected row) or the rowId, but how do I get the index for the setValueAt(x,y, newValue) method of the DefaultDataModel?

I like to implement a change, when the user presses a key, e.g. for rating a row entry (1-5).

Very cool stuff (I'm using 0.31)

Thanks

Christian

jack.slocum
13 Sep 2006, 12:18 PM
.31 I manually put a rowIndex property on every row. So getSelectedRow().rowIndex will give you the row index.

I decided since that locked me into that property forever it wasn't really a good idea and added grid.getSelectedRowIndex() and grid.getSelectedRowIndexes() to the version coming shortly.

Jack