在jqGrid树中选择多行 [英] Selecting multiple rows in jqGrid tree

查看:432
本文介绍了在jqGrid树中选择多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在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.

如果我按住Shift键选择行,则应该选择这些行.我指定的是multiselect: true,但是它不起作用.

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,

推荐答案

限制在文档中似乎并不完整.如果您检查jqGrid的源代码,则可以

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.

如果您确实需要这样的功能,则必须自己实现.为此,您可以在colModel中添加具有的列预定义的复选框"格式化程序,具有formatoptions: {disabled: false}作为附加选项,并实现所需的选择行为.参见答案这一个了解详情.在 beforeSelectRow a>回调.

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.

这篇关于在jqGrid树中选择多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆