Extjs grid traverses the store, extjsgrid calendar store
Var projectMemberGrid = Ext. getCmp ("projectMemberGrid ");
Var selFuns = [];
ProjectMemberGrid. store. each (function (rec ){
SelFuns. push (Ext. encode (rec. data ));
});
How to traverse grid data in Extjs (displays data)
"That is to say, the data displayed in the grid is not necessarily the store data." This sentence is wrong!
The data you load using the store is parsed by Record. That is to say, the store installs the array after record Resolution, and the objects in the array are the objects parsed by your record. What you said is that the renderer method is used to display the data in the store to the grid. The renderer belongs to the ColumnModel and is only used for display on the grid, the only truly recorded data is sotre!
There are two ways to solve this problem:
1. Before you load data to sotre, reorganize the object array, organize it into the data you really want, and load it again!
2. traverse the record records of the store. When traversing the processed dataIndex, You can process the data according to your processing method!
For (var I = 0, len = store. data. length; I <len; I ++ ){
Var data = store. getAt (I). data; // data is an object of the corresponding record.
Data. dataIndex // obtain the value corresponding to the dataIndex attribute of the object.
.........
}
These two types of arguments are the objects of what records you really want, either organized before sotre or organized after traversal! In short, the data loaded by the store will always be held by the store. If you do not remove it or reload it, it will not change!
ExtJS: How can I refresh data when a grid corresponds to multiple stores?
Ext. getCmp ('tasklist _ grie'). reconfigure (taskStore );
The reconfigure parameter can be placed in the store to be rebound. In this case, the fields in store matches the dataIndex in grid columns to display normally.