Results 1 to 2 of 2

Thread: Direct Store Dynamic Synchronous Loading: Major help needed

  1. #1
    Ext User
    Join Date
    Oct 2010
    Vote Rating

    Default Direct Store Dynamic Synchronous Loading: Major help needed


    I am trying to load a js page/object that extends FormPanel as such:
    Application.FeatureDetailForm = Ext.extend(Ext.FormPanel, { ... }

    I am using DirectJNgine services. This FormPanel uses one service (let's call it ServiceA) to load non-dynamic data (only one piece of information per record) and it is stored into form objects like textFields. However, I also have DYNAMIC data that I want to load into fieldsets (each fieldset will contain numerous textFields). This information will be accessed from a different service; let's call it ServiceB. In order to do this, I am using a DirectStore to load the data from ServiceB. Let's call it StoreB.

    In order to populate the FormPanel, I use the var config within initComponent. Within the item's property of the config is where I define all the UI elements of the FormPanel. In the middle of the objects is where I want to insert the dynamic fieldsets from StoreB. To do so, I decide to use the load callback function from the DirectStore. It returns the information perfectly into an array of fieldsets.

    PROBLEM!!! It seems like the config creates the UI items BEFORE the store will load. Now, it is impossible to get the information returned from StoreB's load callback function. Even if I define a function that only calls load and returns the array into the items property, the initComponent will build the UI items without calling load, and load will be called afterwards.

    My coworkers are insisting that this happens because load is asynchronous. I've tried over and over again to figure out how to load the DirectStore SYNCHRONOUSLY, but after hours of ExtJS-induced headaches, I don not know where else to turn to. It seems like the only way to load data synchronously is through ServiceA (no good) or by using the store property of combo-boxes (not what I want).

    Any help is appreciated. I can try to leave code snippets upon request.


  2. #2
    Sencha User
    Join Date
    Jul 2008
    Vote Rating


    I have a similar problem,

    When I draw a tab, I do not know what data there is for this customer...

    So I need to query the database first, wait for the result and add formpanels. I have a solution but with some unwanted side effects I am currently investigating.

    PHP Code:
                                Algemeen.removeAll(); // 'algemeen is a tabPanel with id 'alegemeen'
    cmpny Ext.ModelManager.getModel('Affiliation.model.Company')
    success : function(Company)
    NLAddress Ext.create('',{model 'Affiliation.model.NLPostalAddress',autoLoad true filters: [{property 'AffiliationId'value 3}]});
    NLAddress.on('load', function()
    ADR Ext.create('Affiliation.view.NLPostalAddressForm',{trackResetOnLoad true})
    TelephoneNumbers Ext.create('',
    model 'Affiliation.model.TelephoneNumber',
    autoLoad true ,
    filters: [{property 'AffiliationId'value 3}],
    listeners : {
    load : function()
    Telephone Ext.create('Affiliation.view.TelephoneNumberForm',{trackResetOnLoad true})

    so on for faxnumberetc
    Within my case, all the formpanels are created but:

    the first one (NLPostalAddress) is rendered fine.

    the second one Is rendered fine, but when the 3rd one is loaded, the contents of the 2nd one is suddenly removed from its box.... weird

    the last one stays (as no other one is rendered after it)

    I do not have multiple "same" records at the moment so do not blame it on reusing ADR or Telephone in the loop....

    It seems every day I spoil a lot of time on weird issues... again I blame the docs for that.


Similar Threads

  1. Replies: 0
    Last Post: 26 Aug 2010, 3:57 AM
  2. Synchronous store save?
    By Baris in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 15 Jun 2010, 7:20 AM
  3. 'Dynamic' store loading
    By Wolfie in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 8 Jan 2010, 1:49 PM
  4. Using Ext.Direct with GroupingStore help needed
    By geewhizbang in forum Ext.Direct
    Replies: 1
    Last Post: 8 Aug 2009, 8:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts