侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

datagrid的editor默认编辑器扩展

2023-12-18 星期一 / 0 评论 / 0 点赞 / 31 阅读 / 3527 字

$.extend($.fn.datagrid.defaults.editors,{datetimebox:{init:function(container,options){vareditor=$('

$.extend($.fn.datagrid.defaults.editors, {       datetimebox: {           init: function(container, options){               var editor= $('<input/>').appendTo(container);             options.editable = false;//文本框变成时间框不能让用户输入,否则出错,必须加上该属性            editor.datatimebox(options);//把editor初始化成datatimebox时间框            return editor;           },           getValue: function(target){              // return $(target).val();              //这么写是获得普通文本框的值,easyui的几个框都有自己的setValue和getValue方法             return $(target).datetimebox('getValue');        },           setValue: function(target, value){               //$(target).val(value);               $(target).datetimebox('setValue');        },           resize: function(target, width){               /*            var input = $(target);               if ($.boxModel == true){                   input.width(width - (input.outerWidth() - input.width()));               } else {                   input.width(width);               }              */             $(target).datetimebox('resize',width);//datetimebox控件的方法            },         destory:function(target){             $(target).datetimebox('destroy');//销毁datetimebox的下拉面板控件,input框不需要         }    }   });


广告 广告

评论区