ext 4.2 中如何设置按钮图标?
Ext4.2.1,iconCls设置add图片显示不出来,其他一切正常,按钮也可以正常显示和使用,该如何设置才能显示这个图片,本人还想使用系统自带的图标,求解Ext中的i...
Ext 4.2.1 ,iconCls 设置add图片显示不出来,其他一切正常,按钮也可以正常显示和使用,该如何设置才能显示这个图片,本人还想使用系统自带的图标,求解
Ext中的images文件夹路径到底该如何放,试了好多办法都不行,求解,在线等,谢谢! 展开
Ext中的images文件夹路径到底该如何放,试了好多办法都不行,求解,在线等,谢谢! 展开
1个回答
推荐于2016-08-22 · 知道合伙人互联网行家
关注
展开全部
最好使用 actioncolumn , 显示效果一样...但是设置点击事件要方便的多, 可以查看下API
//下面代码是直接复制的API例子Ext.create('Ext.data.Store', { storeId:'employeeStore', fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'], data:[ {firstname:"Michael", lastname:"Scott"}, {firstname:"Dwight", lastname:"Schrute"}, {firstname:"Jim", lastname:"Halpert"}, {firstname:"Kevin", lastname:"Malone"}, {firstname:"Angela", lastname:"Martin"} ]});Ext.create('Ext.grid.Panel', { title: 'Action Column Demo', store: Ext.data.StoreManager.lookup('employeeStore'), columns: [ {text: 'First Name', dataIndex:'firstname'}, {text: 'Last Name', dataIndex:'lastname'}, { xtype:'actioncolumn', width:50, items: [{ //这里直接通过URL设置图标 icon: 'extjs/examples/shared/icons/fam/cog_edit.png', tooltip: 'Edit', //这里是图标的点击事件 //参数中有点击行的record , 所以很方便做处理 handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Edit " + rec.get('firstname')); } },{ icon: 'extjs/examples/restful/ima ges/delete.png', tooltip: 'Delete', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Terminate " + rec.get('firstname')); } }] } ], width: 250, renderTo: Ext.getBody()});
//下面代码是直接复制的API例子Ext.create('Ext.data.Store', { storeId:'employeeStore', fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'], data:[ {firstname:"Michael", lastname:"Scott"}, {firstname:"Dwight", lastname:"Schrute"}, {firstname:"Jim", lastname:"Halpert"}, {firstname:"Kevin", lastname:"Malone"}, {firstname:"Angela", lastname:"Martin"} ]});Ext.create('Ext.grid.Panel', { title: 'Action Column Demo', store: Ext.data.StoreManager.lookup('employeeStore'), columns: [ {text: 'First Name', dataIndex:'firstname'}, {text: 'Last Name', dataIndex:'lastname'}, { xtype:'actioncolumn', width:50, items: [{ //这里直接通过URL设置图标 icon: 'extjs/examples/shared/icons/fam/cog_edit.png', tooltip: 'Edit', //这里是图标的点击事件 //参数中有点击行的record , 所以很方便做处理 handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Edit " + rec.get('firstname')); } },{ icon: 'extjs/examples/restful/ima ges/delete.png', tooltip: 'Delete', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Terminate " + rec.get('firstname')); } }] } ], width: 250, renderTo: Ext.getBody()});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询