EXT iconCls说明
今天學習ext 看examples中的事例,其中有一個地方是這樣寫的:
new ButtonPanel(
??????????? 'Icon Only',
??????????? [{
??????????????? iconCls: 'add16'
??????????? },{
??????????????? iconCls: 'add24',
??????????????? scale: 'medium'
??????????? },{
??????????????? iconCls: 'add',
??????????????? scale: 'large'
??????????? }]
??????? );
例子的效果是:
看了半天沒有明白iconCls后面的add16 ,add24是什么意思。后來看到buttons.css 終于明白了應該是圖片樣式的意思,既是CSS里面定義的class。
后來看了看API,里面也是這么寫的。遇到什么問題還是多看API。
iconCls : String
用來指定背景圖片的樣式類。A css class which sets a background image to be used as the icon for this button/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
.add {
??? background-image: url(images/add.gif) !important;
}
.add16 {
??? background-image: url(images/add16.gif) !important;
}
.add24 {
??? background-image: url(images/add24.gif) !important;
}
.btn-panel td {
??? padding-left:5px;
}
h2 {
??? color:#083772 !important;
??? margin: 20px 0 0 !important;
??? padding: 5px;
??? background:#eee;
??? width:400px;
}
h3 {
??? font-weight:normal !important;
}
總結
以上是生活随笔為你收集整理的EXT iconCls说明的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: EXT按钮事件
 - 下一篇: extjs关于jsonreader