Results 1 to 3 of 3

Thread: Store.load callback function problem

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    242
    Vote Rating
    6
      0  

    Default Store.load callback function problem

    I am using the following snippet in my code:

    Code:
            store.load({
                params:{paramMap},
                callback : function(records, options, success) {
                    if (success) {
                        var form = formPanel.getForm();
                        var jsonStr = Ext.JSON.encode(records[0].raw);
                        var jsonObj = Ext.JSON.decode(jsonStr);
                        form.loadRecord(jsonObj);
                    }
                }
            });
    This retrieves data passed from the server in JSON format and loads it into the form panel.
    The callback function loads records with raw data. The data fields remain empty. Hence i have to use encode and decode to get the records in the right format.
    Please help me in understanding why the records raw data is populated and not the data.
    Am i going wrong somewhere??

    Thanks
    Rabi
    Last edited by mitchellsimoens; 12 Mar 2012 at 6:40 AM. Reason: added [CODE] tags

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1382
      0  

    Default

    loadRecord is expecting a model instance not an object
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    242
    Vote Rating
    6
      0  

    Default

    loadrecord() works fine above...the doubt i have is regarding records[0].raw.
    The records data should be populated, but i can only see raw data populated

    Help

Posting Permissions

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