PDA

View Full Version : MultiCellSelectionModel along with CheckboxModel



cpsarathe
22 Sep 2014, 6:26 AM
Hi ,

In my current project we are using grid and checkbox selection model for displaying checkboxes in it , selecting rows,deleting those rows , adding new rows to the before or next of currently selected rows.

However new requirement came up to support multicell selection almost like Excel functionality. MultiCellSelectionModel posted here (http://www.sencha.com/forum/showthread.php?214050-Multicell-selection-mode-on-grid)offers some of the feature we are looking for.
But it seems either I could keep checkbox model (RowModel) or multicell selection model (CellModel), and not both .

Is there any way by which I can implement both the functionality ?

slemmon
23 Sep 2014, 9:01 PM
Hi,

The cellmodel selection model doesn't allow for multiple cells to be selected at the same time you can use the cellmodel selection model and the check column to achieve what you're looking for I'd think.
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.grid.column.Check

cpsarathe
6 Oct 2014, 1:15 AM
Hi,

Thanks for the reply and Sorry for replying it late.

I could able to achieve required functionality using MutliCellSelectionModel and injecting CheckboxModel in it. I had to handle cellClick and cellKeyDown event on Grid to achieve it.

e.g
in MultiCellSelectionModel constructor


this.checkboxModel = Ext.create('Ext.selection.CheckboxModel',{
checkOnly: me.checkOnly,
injectCheckbox: me.injectChaeckbox
});
In controller on cellKeyDown-

var selModel = view.getSelectionModel().checkboxModel;
selModel.select(record,true);

Thanks again for your suggestions.

asahoo
7 Oct 2014, 2:44 AM
i think u can use checkbox selection model and inside that u can specify the mode config for multiselect/Single select.