Forum
November 2nd, 2014
A
A
A
Topic RSS
Offline
The forums are currently locked and only available for read only access


Enable multiselect
15/09/2010
09:17
09:17

jhermsen
Member
Members
Forum Posts: 7
Member Since:
23/02/2010
23/02/2010

I enabled multiselect in the TreeGrid and haven't found an issue yet so I thought I'd share the thing I did.
In the grid.base.js find:
if(this.p.treeGrid === true){
try { $(this).jqGrid("setTreeGrid");} catch (_) {}
if(ts.p.datatype != "local") { ts.p.localReader = {id: "_id_"}; }
}
try { $(this).jqGrid("setTreeGrid");} catch (_) {}
if(ts.p.datatype != "local") { ts.p.localReader = {id: "_id_"}; }
}
Then move the part just below it of multiselect above this tree grid section so it looks like:
if(this.p.multiselect) {
this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>");
this.p.colModel.unshift({name:'cb',width:isSafari ? ts.p.multiselectWidth+ts.p.cellLayout : ts.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:'center',fixed:true});
}
if(this.p.treeGrid === true) {
try { $(this).jqGrid("setTreeGrid");} catch (_) {}
if(ts.p.datatype != "local") { ts.p.localReader = {id: "_id_"}; }
}
this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>");
this.p.colModel.unshift({name:'cb',width:isSafari ? ts.p.multiselectWidth+ts.p.cellLayout : ts.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:'center',fixed:true});
}
if(this.p.treeGrid === true) {
try { $(this).jqGrid("setTreeGrid");} catch (_) {}
if(ts.p.datatype != "local") { ts.p.localReader = {id: "_id_"}; }
}
Then you just niet to remove the disabling of the multiselect in the setTreegrid method of grid.treegrid.js:
setTreeGrid : function() {
return this.each(function (){
var $t = this, i=0, pico;
if(!$t.p.treeGrid) { return; }
if(!$t.p.treedatatype ) { $.extend($t.p,{treedatatype: $t.p.datatype}); }
$t.p.subGrid = false; $t.p.altRows =false;
$t.p.pgbuttons = false; $t.p.pginput = false;
// re-enable multiselect $t.p.multiselect = false;
$t.p.rowList = [];
return this.each(function (){
var $t = this, i=0, pico;
if(!$t.p.treeGrid) { return; }
if(!$t.p.treedatatype ) { $.extend($t.p,{treedatatype: $t.p.datatype}); }
$t.p.subGrid = false; $t.p.altRows =false;
$t.p.pgbuttons = false; $t.p.pginput = false;
// re-enable multiselect $t.p.multiselect = false;
$t.p.rowList = [];
Please also let me know if you do happen to run into issues.
Forum Timezone: Europe/Sofia
Most Users Ever Online: 715
Currently Online:
57 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66