arnair
3 Nov 2006, 12:55 PM
First off: incredible work Jack. I'm having a blast using your libraries in my app, and learning some advanced javascript form your code while I'm at it.
I have an issue that I haven't been able find a solution for as yet - I need to figure out if just one row or multiple rows have been selected in the grid.
My app has a details pane next to the grid and the idea is to retrieve and show details in that pane if a single row has been selected, and disabling it and showing "Multiple rows selected" if more than 1 row has been selected.
I've been playing around with both onRowSelect and onSelectionChange on the DefaultSelectionModel. The problem is that I get a series of events in either case when selecting a range of rows (using Shift+click). Ideally, I'd like to somehow narrow these down to two events:
1. Single row selected - here's the row index, and
2. Multiple rows selected
I tried checking for getCount() in the event listeners, but if I select a row and then Shift-click two rows down I get the selection counts as 0, then 1, then 2 (the grid seems to deselect the currently selected row, then select it again). The sel count=1 event is interpreted by my app as a single row select and so it fetches the details for that row from the server, but then it immediately gets the sel count=2 event and hides the details pane.
It's not a showstopper, but an annoyance. Anyway I can eliminate this? Thanks!
BTW, library version is 0.32.3.1.
I have an issue that I haven't been able find a solution for as yet - I need to figure out if just one row or multiple rows have been selected in the grid.
My app has a details pane next to the grid and the idea is to retrieve and show details in that pane if a single row has been selected, and disabling it and showing "Multiple rows selected" if more than 1 row has been selected.
I've been playing around with both onRowSelect and onSelectionChange on the DefaultSelectionModel. The problem is that I get a series of events in either case when selecting a range of rows (using Shift+click). Ideally, I'd like to somehow narrow these down to two events:
1. Single row selected - here's the row index, and
2. Multiple rows selected
I tried checking for getCount() in the event listeners, but if I select a row and then Shift-click two rows down I get the selection counts as 0, then 1, then 2 (the grid seems to deselect the currently selected row, then select it again). The sel count=1 event is interpreted by my app as a single row select and so it fetches the details for that row from the server, but then it immediately gets the sel count=2 event and hides the details pane.
It's not a showstopper, but an annoyance. Anyway I can eliminate this? Thanks!
BTW, library version is 0.32.3.1.