Hello,
I have a gridpanel in a form with a CheckboxModel, when I load the store, I have a callback that find the requested records and selects the rows, but I found that only the last record is selected.
I try adding 'multiSelect: true, simpleSelect: true' in the grid configuration, but result doesn't change.
Here's some code
GRIDPANEL view:
PHP Code:
Ext.define('Smqs.view.knowledgebase.KlbGroupGrid', {
extend: 'Ext.grid.Panel',
requires: ['Ext.selection.CheckboxModel'],
alias: 'widget.smqs-klbgroupgrid',id:'klbgroupgrid',
height: 154,
multiSelect: true, simpleSelect: true,
store:'Groups',
viewConfig:{enableRowBody:true},
initComponent: function(){
var me = this,
aColumns = [
{text: 'NAME', width:'95%', dataIndex:'GRNO'}
],
sm = Ext.create('Ext.selection.CheckboxModel', {mode : 'MULTI'});
Ext.apply(this,{selModel: sm, columns: aColumns});
this.callParent();
}
});
WINDOW controller (init - show)
PHP Code:
Ext.getStore('Groups').load({
callback: function (records, operation, success) {
var vire = val.down('form').down('#klbgroupgrid').getView();
vire.select(0);
vire.select(1);
vire.select(2);
//for (var i=0;i<nure;i++) {
// var rowIndex = this.find('GRID', parseInt(arre[i]));
// if (rowIndex>=0) {
// vire.select(rowIndex);
// }
//}
}
});
I've commented the loop and forced to select the first three rows and
only the 3rd row results selected.
Thanks in advance