1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default Ext.data.Store reader xml does not map values to model

    Ext.data.Store reader xml does not map values to model


    Code:
    var store = Ext.create('Ext.data.Store', {
        model: 'mymodel.model.WorkItemQueue',
        autoLoad: true,
        proxy: {
            type: 'memory',
            reader: {
    		type: 'xml',
    		rootProperty: 'root',
                    record: 'user',
    		idProperty: 'id'
            }
        }
    });
    then i call workitemListStore.loadData(doc); where doc is from new DOMParser().parseFromString(xmlstring, 'text/xml');

    i actually am able to get the value of the model's id (since I specified it in idProperty). however, the other fields of model User contain null values.

    am i missing something? any ideas?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Why not use an ajax proxy to remotely load the xml?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default


    i also plan to do that. i just wanted to see how it works if i load it locally through a declared variable with xml string.

    i managed to solve it now. the only thing lacking in my model class is that there is no mapping. the docs never mentioned that

Thread Participants: 1