got a custom class which returns an empty grid.same class does some ajax request and later updates the grid....
var grid = new Ext.grid.EditorGridPanel({
title : 'test title'
});
grid.renderTo = 'divTop';
//rest all configs, store,tbar .....
is this much enough to render the gridpanel.
or needs to call some methods like grid.render()
//here is miniature of the code
Code:
var myNS = {}; //defining a namespace
myNS.myClass = function () { //defining a class
return {
initGrid: function (config) { //defining a method with in class
var grid = new Ext.grid.EditorGridPanel({
title: config.title
});
Ext.Ajax.request({
url: url,
disableCaching: false,
success: function (response) {
DrawGrid(response)
}
});
function DrawGrid(response) { //definig private method
//process response.responseXML
var store = new Ext.data.Store({......
});
grid.renderTo = 'divTop'; //a div in body..
.......
tbar,store,bbar etc.....
store.on('load', function () {
grid.show()
});
store.load();
}
return this;
}
}
} (); //this initialise this class
var newGrid = myNS.myClass.initGrid(config);