[英]How to jqGrid dynamic multiselecet?
I hava jqGrid checkbox column,This dynamic build我有 jqGrid 复选框列,此动态构建
colNames: ['Id', 'True/False'],
colModel: [
{ name: 'Id', index: 'Id', sorttype: "int", hidden: false },
{
name: "Selected", index: 'Selected', width: 70, align: "center",
formatter: "checkbox", formatoptions: { disabled: false },
editable: false, editoptions: { value: "True:False", defaultValue: "No" },
stype: "select", searchoptions: {
sopt: ["eq", "ne"],
value: ":Any;true:Yes;false:No"
},
},
this code selected columns is checkbox how to this column is multiple selection with its own feature jqGrid此代码选择的列是复选框如何选择此列具有自己的功能 jqGrid
Multiselect: true多选:真
And I cant checkbox value (true or false ) How can I do it?而且我不能复选框值(真或假)我该怎么做? ;
;
If selected column value is true, get multiselect (jqGrid feature) true If selected column false,get multiselect column false如果选择的列值为真,则获取多选(jqGrid 功能)如果选择的列为假,则获取多选的列假
Thank you in advance for your help.预先感谢您的帮助。 I wish you a good day.
祝你美好的一天。
JavaScript is sensitive on the code: JavaScript 对代码很敏感:
To enable multiselection use the following code:要启用多选,请使用以下代码:
$("#grid_id").jqGrid({
...
multiselect : true,
...
});
To get the selected rows when a multiselect is enabled do:要在启用多选时获取选定的行,请执行以下操作:
var selectedRows = $("#grid_id").jqGrid('getGridParam', 'selarrrow');
The selectedRows variable is array which every element is a selected row id. selectedRows 变量是数组,其中每个元素都是一个选定的行 ID。 If notihing is selected the array is empty - ie selectedRows.length = 0;
如果未选择,则数组为空 - 即 selectedRows.length = 0;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.