Dynamically add and remove components to a window using a remote js.
I have created a Window in which there are a grid and tbar. I have added a menu in the tbar, and on selecting one of the menu items i want to remove the current grid 开发者_StackOverflow中文版and load a new grid from a file which is stored at the servers side. How can i do this.
I have tried using 'Loader' with the window. I was able to remove the child component [grid] using 'remove', but how can i access the file at the server side process it and add it as child to the window?
Nikhil
Load new data for grid data using AJAX:
http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/xml-grid.html
http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/remote-group-summary-grid.html
Remove old grid and insert new using remove
and insert
functions:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.window.Window
But I think it's not the best way. If you already have grid on window, just use store
with ajax proxy
to get data from server.
精彩评论