Extjs4自定义按钮样式

来源:互联网 发布:奇兔刷机软件有毒 编辑:程序博客网 时间:2024/05/19 16:51

首先定义css样式

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. <style type="text/css">  
  2.         .settings{background: url(images/settings.png) no-repeat !important;}   
  3.     </style>      


然后创建grid

[javascript] view plaincopy在CODE上查看代码片派生到我的代码片
  1. var test_grid = Ext.create('Ext.grid.Panel',{  
  2.     title: 'Test',  
  3.     id: 'test_grid_id',  
  4.     bbar: [  
  5.        '->',  
  6.        {text: 'test',  iconCls: 'settings',handler: function(){  
  7.            alert("test!!");  
  8.        }},  
  9.     ],  
  10.     columns: [  
  11.         {text: "MsgId", dataIndex: 'MsgId',hidden: true},  
  12.                 {text: "Read", dataIndex: 'Read'},  
  13.                    {text: "Subject", flex: 1, dataIndex: 'Subject'}  
  14.                ]  
  15. }); 
0 0