jcamozzi
13 Apr 2012, 10:17 PM
Hi All -
I'm still pretty new to ExtJs 4 and I'm trying to get a feel for where and how to manipulate data. Currently I have an example running that pulls issues from an issue tracker (jira) and displays the results in a grid. I have a general understanding of Models and Stores, but now I'm trying to do the following:
Pull all data from the store
Aggregate the data to get specific information, such as the following:
Total estimated hours for the issues returned
Estimated hours remaining of work
Breakdown of issues per assignee
Breakdown of estimates per issue
etc.
Use various form controls to manipulate this data for different scenarios
Now, I'm not asking for help on the "how to do all of the above" but rather, I'm seeking advice on where best to DO this work. Do I:
Put code in the "load" function of the store to aggregate / prepare the data?
Add a function to the model (seems wrong, as I think a model in this context is a single record)
Create a controller and add logic to aggregate after the store loads?
There seem to be many places I can do this, but I'm trying to figure the "best" place. Whatever the results of the aggregation I will need to store data somewhere. It could be that I'm actually manipulating the data (i.e. adding extra fields) or even needing a separate "store" for the new data to go to.
In theory I suppose I can also do the manipulations "on the fly" based on some kind of "process" button. That would lead me to think I should do it in the controller.
Has anyone needed to do something similar? Any thoughts / advice on the best place to put such aggregation code?
Thanks in advance!
-Jeff
I'm still pretty new to ExtJs 4 and I'm trying to get a feel for where and how to manipulate data. Currently I have an example running that pulls issues from an issue tracker (jira) and displays the results in a grid. I have a general understanding of Models and Stores, but now I'm trying to do the following:
Pull all data from the store
Aggregate the data to get specific information, such as the following:
Total estimated hours for the issues returned
Estimated hours remaining of work
Breakdown of issues per assignee
Breakdown of estimates per issue
etc.
Use various form controls to manipulate this data for different scenarios
Now, I'm not asking for help on the "how to do all of the above" but rather, I'm seeking advice on where best to DO this work. Do I:
Put code in the "load" function of the store to aggregate / prepare the data?
Add a function to the model (seems wrong, as I think a model in this context is a single record)
Create a controller and add logic to aggregate after the store loads?
There seem to be many places I can do this, but I'm trying to figure the "best" place. Whatever the results of the aggregation I will need to store data somewhere. It could be that I'm actually manipulating the data (i.e. adding extra fields) or even needing a separate "store" for the new data to go to.
In theory I suppose I can also do the manipulations "on the fly" based on some kind of "process" button. That would lead me to think I should do it in the controller.
Has anyone needed to do something similar? Any thoughts / advice on the best place to put such aggregation code?
Thanks in advance!
-Jeff