Question

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 functions and stuff. Is there a better way to do what the "default" variable does for me?

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top