easyUI中datagrid 将 text 设为不可编辑

tuo_bing 2011-04-25 09:24:11
在 easyUI 的 datagrid 中, 有editor 为 text 的一个字段

{field:'price',title:'价格',width:80,editor:'text'}


如何设置这个 text 不能编辑(disabled=true) ?
...全文
620 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tiver2010 2011-04-27
  • 打赏
  • 举报
回复

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



去研究下 ~~~~~~~~~
tuo_bing 2011-04-25
  • 打赏
  • 举报
回复
知情者帮帮 , 如果分不够可以再加 ~~~

87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧