EXT iconCls说明
发布日期:2021-06-30 19:27:07 浏览次数:2 分类:技术文章

本文共 838 字,大约阅读时间需要 2 分钟。

 

今天学习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.
*
*
*/
.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;
}

转载地址:https://linuxstyle.blog.csdn.net/article/details/6865702 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:extjs关于jsonreader
下一篇:EXT按钮事件

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月18日 16时01分55秒