Datagrid Editor 添加timespinner

时间:13-05-16 栏目:EasyUI 作者:zongyan86 评论:0 点击: 8,697 次

01    $.extend($.fn.datagrid.defaults.editors, {
02        timespinner : {
03            init : function (container, options) {
04                var input = $('<input/>').appendTo(container);
05                input.timespinner(options);
06                return input
07            },
08            getValue : function (target) {
09                var val = $(target).timespinner('getValue');
10            },
11            setValue : function (target, value) {
12                $(target).timespinner('setValue', value);
13            },
14            resize : function (target, width) {
15                var input = $(target);
16                if ($.boxModel == true) {
17                    input.resize('resize', width - (input.outerWidth() - input.width()));
18                } else {
19                    input.resize('resize', width);
20                }
21            }
22        }
23    });
24
25    用法:
26    {
27        field : 'xxxxx',
28        width : 100,
29        editor : {
30            type : 'timespinner',
31            options : {//属性
32                required : true
33            }
34        }
35    }



声明: 本文由( zongyan86 )原创编译,转载请保留链接: Datagrid Editor 添加timespinner

关注我们