Grid with Dynamic Columns in ExtJS 4.2.1 MVC
Can we create a Dynamic Grid? Lets say I want to display a grid on the center region of the Viewport.
I'm following MVC approach in ExtJS 4.2.1 and hence I have defined a Model, View and controller for the Grid.
Now I want the Grid to be dynamic, which means, based on the JSON data coming from the server, I want to create the Grid. If JSON data gives 3 columns with Column Header name and Content, I should display 3 columns. If it gives data for 5 columns with Column Header name and content, I should display 5 coulmns.
Is it possible to have a common model to handle this?
Please share an example if possible.
Can you please give me a working example?
Thanks for the link. But somhow I'm still not convinced with the description.
Can you please brief me about that like do we need to create the Model on the Fly?
If so, how to configure the columns and the data to it?
Can you please give me a sample example to my question above so that I can understand better?
I want to know the JSON format also. Request you to provide a sample example in MVC.
As I'm following MVC approach in My application, I would like to know with little more details on how we can create Grids dynamically.
How to attach the store of the Dynamic Grid to the pagingtoolbar?
I got the dynamic Grid with above example. But how to attach the store of this dynamic grid to the pagingtoolbar so that we will be able to see how many records are there.
I tried ;--> store:this.store but it didnt work.
Can someone please suggest me how we can get this?
Is there any way to achieve the above task? (Making Store work with Dynamic Grid)