Extjs grid traverses the store, extjsgrid calendar store

Source: Internet
Author: User

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.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.