PDA

View Full Version : using CheckboxSelectionModel to select multiple rows



pierreli
26 Feb 2015, 5:58 AM
Hello,
I'm new to ExtJS, the version is 3.4.0.
Now what I want to do is when I select one row, all the other rows which have the same ''actionId'' will be selected too. Any ideas?
Here is part of my code



var xg = Ext.grid;

var checkboxSelector = new xg.CheckboxSelectionModel({
header:'',
handleMouseDown:Ext.emptyFn,
listeners : {
'rowselect': function(selectionModel, rowIndex, record){
var valueSelected = record.get('actionId');
}
}
});


var erroneousActionsGrid = new xg.GridPanel({
id:'erroneousActionsPanel',
layout: 'fit',
store: store,
cm: new xg.ColumnModel([
checkboxSelector,
{header: "Action Name", width: 80, sortable: true, dataIndex: 'actionName'},
{header: "Action Id", width: 30, sortable: true, dataIndex: 'actionId'},
{id:'files',header: "File Id", width: 30, sortable: true, dataIndex: 'fileId', renderer: function(value, metaData, record, rowIndex, colIndex, store) {return '<a href=file/lifeCycleFile/'+ value +'>' + value +'</a>'; }},
{header: "Task Id", width: 30, sortable: true, dataIndex: 'taskId'},
{header: "User Name", width: 50, sortable: true, dataIndex: 'userName'},
{header: "Execute Date", width: 30, sortable: true, dataIndex: 'executeDate', renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
]),
bbar: actionListPagingBar,
plugins: [{
ptype: 'perpagefield',
beforeText: ''
}],
sm: checkboxSelector,


thanks in advance