OS3Grid Example 6 - Rows selection

By Fabio Rotondo - fsoft (@) sourceforge ( dot ) net

Main Page
Simple Grid
Sortable Grid
Sortable Grid
Editable Grid
Custom Callbacks
Rows Selection
Column Resize
Column Renderers
Setting and Using Styles
Using OS3Grid to edit a dataset
Advanced Cell Value Manipulation
Support OS3Grid
Since version 0.3o of the grid, the user is able to select / deselect rows by simply clicking on a row number. You have to enable it, anyway, with some code similar to this:
				// Enable row selection
				g.set_row_select ( true );
		
If you want more control over row selection, you can set a callback, similar to this one:
				function rowsel ( grid, row, selected )
				{
					alert ( "Row sel on grid: " + grid + " - row num: " + row + " - sel: " + selected );
				}
		
and set the callback to the grid with some code:
				g.onrowselect = rowsel;
		
That's all! The final result is shown below.