简体   繁体   中英

Retrieving/Returning GXT3 Grid Values

I have been working on with a grid element from GXT and have had some trouble trying to get all the data from a grid for further manipulation. For example:

I have a grid that looks like the following

Colors


Red

Green

Blue


Is there a way to pull all the values from the grid?

You can try to retrieve all the data that loaded to grid from the ListStore object that you feed to the Grid constructor. Here is some code snippet:

List<YourModelDataClass> listData = listStore.getAll();
foreach(YourModelDataClass md : listData) {
   // do whatever you need to do with the data from your grid
}

Hope this could help you. Note: this was the code for sencha GXT 3.0.1 above. Just let me know if you need the code for sencha GXT 2.x above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM