View Full Version : Timing issues related to loading data for combo boxes in EditorGridPanel ...

12 Oct 2010, 9:53 AM
What are my options and/or the preferred way to handle loading data for combo boxes used in an EditorGridPanel that MUST be loaded prior to editing?

Case in point, I'm using the RowEditor plugin within a custom EditorGridPanel. Three of the columns require a combobox as an editor that in turn use a store configured to fetch its data via JSON from the server. I need to "wait" until the data is received by all three before I edit else I see Ids (the valueField) instead of text (the displayField) in the combo the first time I go into edit mode.

I know this is a common issue ... again, just interested to know the best way to solve.


12 Oct 2010, 9:58 AM
Welcome to the club buddy,
I was exactly in the same situation a couple of days ago, but i was pointed in the right direction. Here is my thread, basically it boils down to using the "callback" option of the load event on the store you are using to chain the processing of your data.

http://www.sencha.com/forum/showthread.php?111872-JsonStore-Load-Question (http://www.sencha.com/forum/showthread.php?111872-JsonStore-Load-Question)

It worked for me

12 Oct 2010, 10:11 AM
Is there a way to chain the loading of all these comboboxes ONLY when user first double-clicks on row to go into Edit mode?

I'm thinking of something like this:
1. User double clicks to go into edit mode
2. Check is done to see if combo's have data
3. If combo's do have data ... then immediately show roweditor and allow user to make modifications
4. If combo does not have data ... load combo1 ... have combo1's callback load combo2 ... have combo2's callback load combo3 ... and have combo3's callback do something to indicate that the row is "now" ready to be edited. Then show RowEditor.