<th data-options="field:'relationship',width:120,editor:{type:'text',options:{disabled : true}}">关系</th>
写disable:true,不行,应为text没有那个属性,,该怎么写??
------解决方案--------------------
editor 就是可编辑的。不可编辑,你就不要用 editor
$.extend($.fn.datagrid.defaults.editors, {
text: {
init: function(container, options){
var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
return input;
},
getValue: function(target){
return $(target).val();
},
setValue: function(target, value){
$(target).val(value);
},
resize: function(target, width){
var input = $(target);
if ($.boxModel == true){
input.width(width - (input.outerWidth() - input.width()));
} else {
input.width(width);
}
}
}
});