jQuery EasyUI — 重写datagrid的combotree编辑类型
来源:互联网 发布:网络语言拔草什么意思 编辑:程序博客网 时间:2024/04/29 02:10
1.重写combotree单选
(1)重写combotree定义代码:
// 重写combotree单选$.extend($.fn.datagrid.defaults.editors, {combotree_single : {init : function(container, options) {var box = $('<input />').appendTo(container);box.combotree(options);return box;},getValue : function(target) {var t = $(target).combotree('tree', target);var n = t.tree('getSelected');return n;},setValue : function(target, value) {if (value) {$(target).combotree('setValue', value.id);}},resize : function(target, width) {var box = $(target);box.combotree('resize', width);},destroy : function(target) {$(target).combotree('destroy');}}});(2)调用代码:
options未使用url的请求方式,而是用data本地加载,防止每次点击列表行的时候都需要发送url远程加载。
{field:'fieldName',title:'标题',align:'center',sortable:true,resizable:true,editor:{type:'combotree_single',options:{data: getTreeData()}}, formatter:function(value,row,index){if(value) {return value.text;}}}(3)combotree传入数据方法:
使用ajax请求的方式。
function getTreeData() {var treeData = null;$.ajax({type : 'post',url : '', // 得到数据的URL地址cache : false,async : false,dataType : 'json',data : {}, // 请求参数success : function(result) {treeData = result;}});return treeData;}2.重写combotree复选
// 重写combotree复选$.extend($.fn.datagrid.defaults.editors, {combotree_multiple : {init : function(container, options) {var box = $('<select multiple />').appendTo(container);box.combotree(options);return box;},getValue : function(target) {var t = $(target).combotree('tree', target);var n = t.tree('getChecked');return n;},setValue : function(target, value) {if (value != undefined && value.length > 0) {var arrId = new Array();for (var i = 0; i < value.length; i++) {arrId.push(value[i].id);}$(target).combotree('setValues', arrId);}},resize : function(target, width) {var box = $(target);box.combotree('resize', width);},destroy : function(target) {$(target).combotree('destroy');}}});
0 0
- jQuery EasyUI — 重写datagrid的combotree编辑类型
- jQuery EasyUI — 重写datagrid的combotree编辑类型
- jQuery EasyUI — 重写datagrid的datetimebox编辑类型
- jQuery EasyUI — 格式化显示datagrid的numberbox编辑类型
- 扩展jQuery easyui datagrid增加动态改变列编辑的类型(treegrid也适用)
- 扩展jQuery easyui datagrid增加动态改变列编辑的类型
- 转帖:扩展jQuery easyui datagrid增加动态改变列编辑的类型
- jquery easyui的datagrid,使用combotree作为editor不能多选的问题
- jQuery EasyUI — 只选择combotree的叶子节点
- jQuery EasyUI 在datagrid上使用combotree 进行多选
- jQuery EasyUI 在datagrid上使用combotree 进行多选
- 【EasyUI】——可编辑的DataGrid
- JQuery EasyUI combotree
- jquery easyUI ComboTree使用方法
- jQuery easyui combotree
- jquery easyui combotree
- JQuery easyui datagrid 获取正在编辑的行索引
- jQuery-easyUI的使用:datagrid实现可编辑表格
- Android 读取图片方向信息
- 作为程序员,不得不知道的App推广知识
- Android动画之Property Animation(二)
- OUTLook 无法搜索,搜索变灰的处理
- bash代码注入的安全漏洞
- jQuery EasyUI — 重写datagrid的combotree编辑类型
- fflush和fsync的联系和区别
- Packet Tracer 5.0实验(一) 交换机的基本配置与管理
- csdn下载频道,我去年买了个包,登山包,超耐磨
- opevcv3.0.0 在Visual Studio 2013下的项目预处理
- 张宇光_P2P能否成为金融巨无霸
- c++中修饰思想的分析
- 多个不同站点服务器数据同步到总服务器
- java 十进制转换为二进制、八进制和十六进制原理