easyui datagrid 可编辑单元格 显示 clear icon 和 放大镜图标

html 部分

主要是这句话 <th data-options=“field:‘attr1’,width:250,editor:{type:‘searchbox’}”>Attribute</th>
在这里插入图片描述
js部分
. e x t e n d ( .extend( .extend(.fn.datagrid.defaults.editors, {
searchbox: {
init: function(container, options) {
var input = $(’<input type=“text” class=“easyui-textbox”>’).appendTo(container);
).appendTo(container);
input.textbox({
//添加清除图标
icons: [{
iconCls: ‘icon-clear’,
handler: function (e) {
input.textbox(‘clear’);
//modelTextClear(curField);
}
},
{
iconCls:‘icon-search’,
handler: function(e){
var v = $(e.data.target).textbox(‘getValue’);
alert('The inputed value is ’ + (v ? v : ‘empty’));
}
}
]
});
return input;
},
getValue: function(target) {
return $(target).searchbox(‘getValue’);
},
setValue: function(target, value) {
$(target).searchbox(‘setValue’, value);
},
resize: function(target, width) {
$(target).searchbox(‘resize’, width);
}
}
});

行编辑带着清楚按钮和放大镜

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值