简体   繁体   English

动态更改 extjs jsonreader 字段

[英]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.我正在研究 Extjs 图表我有一个允许多单元格选择的网格,单击的每个单元格都将成为一个系列,将添加到图表中,所以我管理一个直接存储,基本上它将具有固定字段(月份,value0),但是每次单击单元格时,它都会加载商店返回新信息(jsonreader 的新字段),例如 Month、Value0、Value1。 being value1 the new field to create the serie.作为 value1 创建系列的新字段。

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我想知道管理存储的可能性,其中 jsonreader 的字段根据请求的数据而变化,例如第一次加载存储时它返回包含两个字段的记录,月份,Value0 然后我们再次询问数据并返回更多字段月份, 值0, 值1, 值2

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.我们只知道加载商店时的新信息,但我知道我们应该在加载商店之前设置 json 读取器属性,但在加载商店之前我不知道有多少字段来自请求。

I hope I was clear enough on it.我希望我对此足够清楚。 I'm working on version 3.4 of extjs我正在开发 extjs 的 3.4 版

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.您可以使用列/行标题的组合命名每个字段(例如单元格 A2),或者您可以使用某种计数器,当用户选择一个新单元格时该计数器会增加。 Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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