easyui datagrid 单行操作中的选择行和取消行
2015-11-04 22:34
543 查看
#easyui datagrid 单行操作中的选择行和取消行
#必要条件
#singleSelect:true
#checkOnSelect:true
#selectOncheck:true
</pre><pre name="code" class="javascript">
var onselect = false; var oncheck = false; $("#test_table").datagrid({ idField : 'id', url : 'url', queryParams:{ }, fitcolumns:true, fit:false, height:310, striped: true , pagination:true, pageNumber:1, singleSelect:true, checkOnSelect:true, selectOncheck:true, pageSize:10, pageList:[10,20,30,40,50], loadMsg : '数据正在加载,请耐心的等待...', columns : [ [ {field:'check',checkbox: true}, { field : 'testId', title : '测试ID', width : 75, sortable:true } ] ], onSelect:function(index,row){ var select = $("#<span style="font-family: Arial, Helvetica, sans-serif;">test_table</span>").datagrid("getSelected"); if(select!=null && onselect==true && select.id == row.id){ $("#<span style="font-family: Arial, Helvetica, sans-serif;">test_table</span><span style="font-family: Arial, Helvetica, sans-serif;">").datagrid("unselectAll");</span> onselect = false; }else{ onselect = true; } }, onCheck:function(index,row){ var check = $("#<span style="font-family: Arial, Helvetica, sans-serif;">test_table</span><span style="font-family: Arial, Helvetica, sans-serif;">").datagrid("getChecked");</span> if(check!=null && oncheck==true && check[0].id == row.id){ $("#test_table").datagrid("uncheckAll"); oncheck = false; }else{ oncheck = true; } }, toolbar:'' }); });
相关文章推荐
- ArrayDeque 源码
- 用UIScrollView和UIPageControl制作相册基本方法
- leetcode-Implement Queue using Stacks
- MVC ueditor的使用(实现上传图片功能)
- Android消息机制 Handler,Looper,MessageQueue
- iOS UI 知识点
- 1017. Queueing at Bank (25)
- 1017. Queueing at Bank (25)
- 动态规划求最长递增子序列(longest increasing subsequence)
- hdoj3975Easy Fruit Ninja
- WinForm UI跨线程访问 Debug模式与非Debug模式下的区别
- zoj 1649 Rescue
- Longest Increasing Subsequence的两种算法
- 2015ACM/ICPC亚洲区长春站 L hdu 5538 House Building
- iOS开发小技巧:刷新UITableView
- UIview的一些基本方法
- XMPP框架 微信项目开发之Socket聊天室发送数据——获取键盘高度,修改控件的约束值,代码滚动UITabView到指定位置
- uiautomator使用
- Qt中用户界面的User Interface Compiler(uic)机制的相关说明
- UE激活