-
31 Aug 2010 3:54 PM #1
combo box store load complete ?
combo box store load complete ?
I have a form that has a combo-box in it. The combobox is populated by some other Rest service request. For, the time being, it takes more time to load than the entire form.
I would want to display waitMsg till every form element load is complete including the combobox.
currently I use -
The 'Loading' message disappears as soon as form is loaded, but combobox is yet to load completelyCode:............ fp.getForm().load({ url: CONTACTS_URL + contactId + '/', method: 'GET', waitMsg: 'Loading'}); ...........
-
31 Aug 2010 6:01 PM #2
YMMV...untested.Code:cb.getStore().load( { ..., listeners: { beforeload: function() { fp.getEl().mask( "Loading" ) ; } }, sucess: function() { fp.getForm().load( { url: ..., method: ..., success: function() { fp.getEl().unmask() ; } ) ; } } } ) ;
Or, you could simply preload the combobox store, if it will contain static values.
-
1 Sep 2010 9:16 AM #3
I think that would be the way to go. However, I would want to do it inside out. That is, load combo store inside the form but not the other way round as shown by you.
here is what i am trying to do -
as in the code snippet how do I pass the form parameter to the load listener of the store ?Code:fp.on({ beforeaction: function(form, action) { if(action.type == 'load'){ //alert('testing'); this.getEl().mask('Loading'); } }, actioncomplete: function(form, action){ if(action.type == 'load'){ //this.getEl().unmask(); var store = this.getComponent('mContactCombo').getStore(); store.on({ load: function(store, records,options) { this.getEl().unmask(); /// this doesn't work } }); } }//end of actioncomplete });
specifically -Code:load: function(store, records,options) { this.getEl().unmask(); /// this doesn't work
-
1 Sep 2010 9:41 AM #4
here is what i am trying to do -
as in the code snippet how do I pass the form parameter to the load listener of the store ?Code:fp.on({ beforeaction: function(form, action) { if(action.type == 'load'){ //alert('testing'); this.getEl().mask('Loading'); } }, actioncomplete: function(form, action){ if(action.type == 'load'){ //this.getEl().unmask(); var store = this.getComponent('mContactCombo').getStore(); store.on({ load: function(store, records,options) { this.getEl().unmask(); /// this doesn't work } }); } }//end of actioncomplete });
specifically -Code:load: function(store, records,options) { this.getEl().unmask(); /// this doesn't work
-
1 Sep 2010 9:54 AM #5
Damn Scope.
Solution -
Code:............... store.on({ 'load':{ fn: function(store, records, options){ //store is loaded, now you can work with it's records, etc. this.getEl().unmask(); }, scope:this } });
Similar Threads
-
Combo box bound to Array Store does not display initial value on first load
By Keith Chadwick in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 15 Jan 2010, 1:35 PM -
Combo box auto complete- Remote load
By nityajs in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 14 Sep 2009, 1:01 PM -
[solved] edit form and combo box, initial load combo box not populating correctly
By extjsF4n in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 20 May 2008, 4:22 PM


Reply With Quote