简体   繁体   中英

change extjs jsonreader fields dynamically

I'm working on Extjs charts I have a grid wich allows multicell selection, each cell clicked becomes in a serie that will be added to chart, so I manage a directstore, basically it will have as fixed fields (month, value0), but each time a cell is clicked it loads store returning new information (new fields for jsonreader), something like Month, Value0, Value1. being value1 the new field to create the serie.

I'm wondering about the posibility to manage a store where fields of jsonreader change depending on data requested, for instance first time store is loaded it returns records with two fields, Month, Value0 then we ask again for data and it returns more fields Month, Value0, Value1, Value2

but how can I configure it to change each time the information is asked to server? We just know about new information when store is loaded but I have understood we should set json reader properties before load the store, but before loading store I don't know how many fields come from request.

I hope I was clear enough on it. I'm working on version 3.4 of extjs

Thanks in advance.

You could either name each field with a combination of column/row titles (ex. cell A2) or you could use some sort of counter that increments when the user selects a new cell. Hope this helps.

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