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);
精彩评论