EXTjs采用监听器的方式修改title的背景颜色

    xiaoxiao2021-03-26  48

    其默认颜色为蓝色,如果想要修改,我目前采用的是这种方式,略微麻烦,如果有更为简单的,敬请补充。

    代码如下:

    Ext.widget({   renderTo : Ext.get('divid'), xtype    : 'grid',   title    : 'Grid',   width    : '100%',   height   : 300,   plugins  : 'rowediting',  listeners : {      'afterrender' : function(grid) {   var elments = Ext.select(".x-panel-header",true);       //   title 的class   elments.each(function(el) {

    el.setStyle("color", 'red');                                         // 修改字体颜色 el.setStyle("background", 'red');                            // 或者使用颜色编码(#FF0000)  修改title的背景颜色为红色 }, this);   }   },

    store:{

    ......

    },

    columns:{

    ......

    }

    });

    红色字体部分便是通过监听器的方式修改tltle的背景颜色的方式了。

    转载请注明原文地址: https://ju.6miu.com/read-449996.html

    最新回复(0)