我尝试使用以下代码在 extjs 的网格面板中添加一个文本文件和一个按钮:
var shopIdInput = new Ext.form.TextField({
emptyText: "请输入商户Id",
width: 200
});
var deleteOneShopCacheBtn = new Ext.Button({
text : '删除商户缓存',
handler: deleteOneShopCache,
minWidth : 100,
cls: "delBtn"
});
......
var grid = new Ext.grid.GridPanel({
store: store,
columns: columns,
bbar: [shopIdInput, deleteOneShopCacheBtn],
buttons: [clearRedressWordCacheBtn, clearSplitWordCacheBtn, clearRegionCacheBtn, clearCategoryCacheBtn, runCommandBtn],
items: [commandForm],
buttonAlign: 'center',
stripeRows: true,
autoExpandColumn: 'serverUrl',
//title: '批量执行指令',
sm: checkboxSelect,
frame: true,
autoHeight: true,
enableColumnHide: false,
renderTo : 'serverInfoList'
});
但是 bbar 中的按钮 deleteOneShopCacheBtn 看起来不像按钮中的按钮 clearRedressWordCacheBtn 那样的普通按钮。当鼠标在它上面时,它会变成一个按钮。我试图通过设置属性 cls 来解决问题,但失败了,我该怎么办?