Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting multiple rows in jqGrid tree

Tags:

jquery

jqgrid

Is there any way to select multiple rows in a jqGrid tree structure? On single clicking on any row I am providing an inline editing facility and on double clicking I am expanding the row.

If I select rows with the shift key held it should select the rows. I am specifying multiselect: true, but it's not working.

rowNum:10,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'no',
treeGridModel:'adjacency',
autowidth:false,
sortorder: 'desc',
caption:"<a href='#'>Projects</a> > Tasks",
toolbar:[true,"top"],
treeGrid: true,
cellEdit: true,
sortable: true,
shrinkToFit :true, 
//viewrecords: true, 
height:'auto',
ExpandColumn:'name',
cellsubmit : 'clientArray',
multiselect:true,
like image 400
lakshmi Avatar asked May 26 '26 12:05

lakshmi


1 Answers

The list of limitations of the current implementation of Tree Greed seems be not full in the documentation. If you examine the source code of jqGrid you will fine the lines which reset some other jqGrid parameters:

multiselect = false;
subGrid = false;
altRows = false;
pgbuttons = false;
pginput = false;
gridview = true;
rowNum = 10000; // if rowTotal is null
rowList = [];

So the current implementation of the Tree Grid don't support selecting of the multiple rows.

If you really need such feature you have to implement it yourself. To do this you can add in colModel the column having the predefined 'checkbox' formatter having formatoptions: {disabled: false} as additional option and implement the behavior of selection which you need. See the answer and this one for details. It could be needed to implement some additional actions in the beforeSelectRow callback.

like image 161
Oleg Avatar answered May 28 '26 00:05

Oleg