delagoutte Posted November 13, 2017 Share Posted November 13, 2017 Hello, See picture please i have a grid with multiselect : true. On image there is row 1 and 2 that are selected. if i click on checkbox (1 on image) i'll have row 1,2,3 that will be selected. but if i click nearby chekc box in cell (2 in image) i'll have only row 3 that will be selected. how can ido for having the click on part 2 = click on part 1 -> if i click on 2 on image that i'll have row 1,2,3 selected ? is it possible ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 13, 2017 Share Posted November 13, 2017 Hello, Maybe like this ?!: UniDBGrid -> ... function beforeitemclick: function beforeitemclick(sender, record, item, index, e, eOpts) { var _selModel=sender.getSelectionModel(); var _selected=_selModel.isSelected(record); if (!_selected) { _selModel.select(record, true); } else { _selModel.deselect(record, false); } return false; } Best regards, Quote Link to comment Share on other sites More sharing options...
delagoutte Posted November 14, 2017 Author Share Posted November 14, 2017 Hello, it is not that i want. With this code, it is working but if click on an other cell in the row the row is selected (as if i have press Ctrl+Click) if i click on an other cell row, the other rows must be unselected. I was wondering if i could do it with this config : http://docs.sencha.com/extjs/4.2.5/#!/api/Ext.selection.CheckboxModel-cfg-checkSelector i try this function checkboxModel.beforeInit(sender, config) { config.checkSelector = "x-grid-row-checker"; } x-grid-row-checker is the default value but I don't know what other values to put Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 14, 2017 Share Posted November 14, 2017 Ok, I will check Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 14, 2017 Share Posted November 14, 2017 Another solution, Can you try to use this approach for now ?!: 1. function beforeitemclick 2. function beforecellclick: function beforecellclick(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) { if (cellIndex == 0) { var _selModel = sender.getSelectionModel(); var _selected = _selModel.isSelected(record); if (!_selected) { _selModel.select(record, true); } else { _selModel.deselect(record, false); } return false } } Quote Link to comment Share on other sites More sharing options...
delagoutte Posted November 14, 2017 Author Share Posted November 14, 2017 Thanks it is working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.