开发者

Is there a better way to default in Touch?

I prototype in touch, but Ext.create tells me to go to heck ( as does Ext.define ) So i'm back to doing

ViewPort= function(c){
    var default={
        fullscreen:true,
        items:[]
    };Ext.apply(default,c);config = default;

    ViewPort.superclass.constructor.call(this,config);
};
Ext.extend( ViewPort, Ext.Panel);

And then manipulating the config with funct开发者_如何转开发ions and stuff. Is there a better way to do what the "default" variable does for me?


This is shorter,and much neater

ViewPort= function(config){
    config=Ext.apply({},config,{
        fullscreen:true
        items:[],
    });

    ViewPort.superclass.constructor.call(this,config);
};
Ext.extend( ViewPort, Ext.Panel);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜