PDA

View Full Version : How do I retrieve "checked" rows, not just "selected" rows in CheckboxSelectionModel?



CHRISDEVELOPER
31 Aug 2009, 8:06 AM
Working with the grid SmartCheckboxSelectionModel, I'm able to load my grid with checkboxes pre-selected, by pointing to a dataIndex in my store that contains true/false values for each record:


var

sm2 =new xg.SmartCheckboxSelectionModel({

dataIndex :'hasaccess',

email :false,

excel :false,
alwaysSelectOnCheck:true
}) ;


I am then using the getSelections() method to retrieve all the checked and selected records the user has chosen. This does not work, however. getSelections() is only retrieving the rows that have been newly selected by the user. I see no method in the API for getting the records that are already checked or a way of making "checked" and "selected" the same.


var sel = grid.getSelectionModel().getSelections() ;


Does anyone have experience working with SmartCheckboxSelectionModel or CheckboxSelectionModel and retrieving "checked" rows? I totally don't understand why they wouldn't have made "checked" and "selected" the same in the API! :((

Animal
31 Aug 2009, 11:02 AM
Explain. "newly selected"??

getSelections returns the selected rows.

CHRISDEVELOPER
31 Aug 2009, 11:35 AM
Sorry, I wasn't clear enough. getSelections() does return any row the user has clicked on to select, but it won't return the rows that were loaded with the checkboxes already checked.

Animal
31 Aug 2009, 11:38 AM
OK, I see. Yep, you should be allowed to "preselect" rows.