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 record开发者_如何学编程s 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.
精彩评论