我是靠谱客的博主 悲凉大船,这篇文章主要介绍【EasyUI】easyui datagrid selectRecord的用法,现在分享给大家,希望可以做个参考。

1、使用后达成效果:表格刷新依旧选中该行

2、配置方法:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//① 如果是js中配置表格,则加上*idField: "id",*配置项 idField: "rowid", //列配置: { field: 'rowid', title: 'ID', width: 30, hidden: true }, //② html中配置表格,则加上*idField="id",*配置项 //具体示例 ---- js配置: var MainGridObj = $HUI.datagrid("#MainGrid", { url: $URL, queryParams: { ClassName: "---", MethodName: "---", data: "" }, fitColumns: false, //列固定 loadMsg: "正在加载,请稍等…", autoRowHeight: true, singleSelect: true, rownumbers: true, //行号 idField: "rowid", singleSelect: true, //只允许选中一行 pageSize: 20, }); //具体示例 --- html中配置 <table id="MainGrid" class="easyui-datagrid" width="100%" idField="id" pagination="true" data-options="checkOnSelect:true" rownumbers="true" fitColumns="true" singleSelect="true"> <thead> <tr> <th field="id" data-options="checkbox:true"></th> <th field="moNo" width="150">号 码</th> </tr> </thead> </table>

3、使用方法:
mainrowid为该行rowid的值

复制代码
1
2
3
4
$("#MainGrid").datagrid("reload"); $("#MainGrid").datagrid('selectRecord',mainrowid); //刷新及选中的顺序对效果没有影响

最后

以上就是悲凉大船最近收集整理的关于【EasyUI】easyui datagrid selectRecord的用法的全部内容,更多相关【EasyUI】easyui内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(52)

评论列表共有 0 条评论

立即
投稿
返回
顶部