`
lbyzx123
  • 浏览: 465029 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

EXTJS 构造函数带参数

 
阅读更多

EXTJS 构造函数带参数的定义如下:

Ext.define('App.dahuatech.ColorWindow',{
 extend:'Ext.window.Window',
 labelid:'',
 constructor:function(labelid){
  me=this;
  if(labelid){
   me.labelid=labelid;
  }
  App.dahuatech.ColorWindow.superclass.constructor.call(me,{
   title:'颜色选择框',
   width    : 80,
         height   : 160,
         bodyStyle: 'padding:20px',
         resizable:false,
         closable: true,
         closeAction: 'hide',       
         items:new Ext.picker.Color({
      value: '993300',
      listeners:{
       select:function(picker,selColor){
        var val=me.labelid;
        //设置label的背景色
        Ext.getCmp(val).getEl().dom.style.backgroundColor=selColor;
        me.close();
       }
      }
  })
 });
 return me;
 }
});

设置label的背景色:  Ext.getCmp('history').getEl().dom.style.backgroundColor='red';

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics