데이터grid의 편집기 기본 편집기 확장

1253 단어
$.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 
         }
    }   
});

좋은 웹페이지 즐겨찾기