PDA

View Full Version : Dynamically creating views using JSON document



anaP
1 May 2012, 3:01 AM
Hi,
I have been using JSON generated through Sencha Architect for views to dynamically generate views.
Ext.Ajax.request({ url :'data\\loginForm.json',

failure: function(response){
console.log('Error! ' + response.responseText);
},
success: function(response, opts) {
form= Ext.decode(response.responseText);

if(viewport.getComponent(0))
viewport.removeAll();
form=viewport.insert(0,form);

form.show();
}
});
I would like to know whether it is a recommended practice and would continue to be supported by ExtJS.

evant
1 May 2012, 3:47 AM
Check out the component-loader demo in the examples.