PDA

View Full Version : a way to tell grid to use all fields from store/model?



dedoz
25 Mar 2012, 12:18 AM
is there an Extjs method or config to tell a grid to use all fields of store model as headers/dataindex ? without configuring each one ?

or a user extension ? i didnt find.

mitchellsimoens
25 Mar 2012, 6:33 AM
The grid doesn't (and shouldn't) have that amount of binding to a store/model.

JIMECKELS
26 Mar 2012, 7:50 AM
I ran into a similar requirement.

My model has about 35 fields. These fields ultimately are to be displayed in the grid (every single one of them, even the ID's).

You can certainly create a grid, where the initComponent or constructor will iterate through the grid.store.model fields, and add them at run-time, however ... you will find that you will need to control alot more regarding these auto-generated columns (ie - editability, column caption, etc).

Ultimately, I just listed all columns at design time in the grid.

dedoz
28 Mar 2012, 2:17 AM
The grid doesn't (and shouldn't) have that amount of binding to a store/model.
?? that amount ?
my model has only 3 or 4 fields, but instead of repeting the process of redeclaring every field in the model while building grids ....