May 17, 2013, 3:56 PM
[CLOSED] Sorting grid groups based on external data
Hello,
I previously learned how to set custom text for group header using a store other than the grouping grid's store, by calling a function referencing values.name. The thread is here. Finally I did what I wanted and the next challange has been faced.
I need to sort grid groups based on a data residing in a store other than the grid's store. Below is a sample scenario.
I have event id's and companies in the grid store and the grid is grouped based on id.
data presentaion in grid's store:
<id1,company1>
<id1,company2>
<id1,company3>
<id2,company1>
<id2,company3>
Event's name is stored in another store and I can set group text fetched from this store as I mentioned above.
data presentation in second store:
<id1, name1, priority1>
<id2, name2, priority2>
Those events have a priority value. I need to sort the grouped grid's groups based on event.priority value. The grid store only has the event id information. event priority is stored in another store. How can I sort the groups in such a scenario?
Current view:
+ Group 1 : Priority : 3
+ Group 2 : Priority : 2
+ Group 3 : Priority : 4
+ Group 4 : Priority : 1
What I need is:
+ Group 4 : Priority : 1
+ Group 2 : Priority : 2
+ Group 1 : Priority : 3
+ Group 3 : Priority : 4
Thanks.
I previously learned how to set custom text for group header using a store other than the grouping grid's store, by calling a function referencing values.name. The thread is here. Finally I did what I wanted and the next challange has been faced.
I need to sort grid groups based on a data residing in a store other than the grid's store. Below is a sample scenario.
I have event id's and companies in the grid store and the grid is grouped based on id.
data presentaion in grid's store:
<id1,company1>
<id1,company2>
<id1,company3>
<id2,company1>
<id2,company3>
Event's name is stored in another store and I can set group text fetched from this store as I mentioned above.
data presentation in second store:
<id1, name1, priority1>
<id2, name2, priority2>
Those events have a priority value. I need to sort the grouped grid's groups based on event.priority value. The grid store only has the event id information. event priority is stored in another store. How can I sort the groups in such a scenario?
Current view:
+ Group 1 : Priority : 3
+ Group 2 : Priority : 2
+ Group 3 : Priority : 4
+ Group 4 : Priority : 1
What I need is:
+ Group 4 : Priority : 1
+ Group 2 : Priority : 2
+ Group 1 : Priority : 3
+ Group 3 : Priority : 4
Thanks.
Last edited by Baidaly; May 20, 2013 at 9:56 PM.
Reason: [CLOSED]