easyui datagrid toolbar 如何用代码添加

如: 如何添加个input 或者select
2025-03-02 11:04:07
推荐回答(3个)
回答1:

{
iconCls: 'icon-help',
text : '搜索:',
handler: function(){
//
}
}

不会很复杂,直接在text里面返回一个input标签就好了

最终效果如图:

回答2:

在html中可以这样写,加上datagrid-toolbar的样式即可







这样就跟工具栏的样式一样的了

回答3:

js 中添加 直接在定义datagrid 的时候加上 toolbar 属性

toolbar: ["-", {
id: '',
text: '',
iconCls: '',
handler: function () {}
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-"]

第二种方法是在页面些个div 在里面可以放入 按钮 输入框 搜索框 之类的 并且给这个div 设置一个 id 然后再定义 datagrid 的地方写 toolbar:"#div的id"