//datagrid 编辑器扩展
$.extend($.fn.datagrid.defaults.editors, {
datetimebox: {
init: function (container, options) {
var input = $('<input type="text" class="easyui-datetimebox">')
.appendTo(container);
//编辑框延迟加载
window.setTimeout(function () {
input.datetimebox($.extend({ editable: false }, options));
}, 10);
//input.datetimebox($.extend({ editable: false }, options));
return input;
},
getValue: function (target) {
return $(target).datetimebox('getValue');
},
setValue: function (target, value) {
$(target).val(value);
window.setTimeout(function () {
$(target).datetimebox('setValue', value);
}, 150);
},
resize: function (target, width) {
var input = $(target);
if ($.boxModel == true) {
input.width(width - (input.outerWidth() - input.width()));
} else {
input.width(width);
}
}
}
});