1. #1
    Sencha Premium Member
    Join Date
    Jul 2013
    Posts
    31
    Answers
    1
    Vote Rating
    1
    jademasterterminal is on a distinguished road

      0  

    Default Unanswered: Help with Ext.data.Store

    Unanswered: Help with Ext.data.Store


    Hi there,

    I am currently upgrading an existing ExtJS based system from 2.2 to 3.4 now 4.2.1.
    I am having some trouble around the upgrade from 3.4 to 4.2.1 regarding Ext.data.Store.

    Before, there seemed to be no need for a 'proxy' or a 'model' when creating a data.Store. But now I am getting errors because they are set-up.

    I looked into this and saw that I need to create Models that are defined by extending Ext.data.Model, the only problem with this is that whenever new model/classes get created (in an external system), there is a tool that automatically generates the JavaScript, not in the required Model format.

    The current set-up I am working with is like this:

    Code:
    store = new Ext.data.Store({
        reader: new Ext.data.XmlReader({
            record: repeatedStoreField
        }, fields),
        data: xml
    })
    'repeatedStoreField' is the name of the class
    'fields' is an array of field names
    'xml' is the raw xml returned from the webserivce

    And an example of a generated class I am working from (of which there are hundreds):

    Code:
    WS_Operator: function(obj){
        if (!obj){
            obj = {};
        } 
        this.WS_ProxyObject(obj); //add attributes from superclass
        obj.code = null;   //(String)
        obj.comboboxDescription = null;   //(String)
        obj.description = null;   //(String)
        return obj;
    }
    I am wondering if there is anyway I can work around the 'proxy' and 'model' requirements when creating a Store, or if I am able to build it dynamically from what I already have?

    Any help would be much appreciated!
    If more detail is needed, please let me know.

    Thanks.

    [Edit] :
    As a bit more detail, the place I am getting an error is on
    me.setProxy(me.proxy || me.model.getProxy());
    Which is within the Ext.data.AbstractStore constructor

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,770
    Answers
    355
    Vote Rating
    165
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    You dont' have to have a proxy and model configured in the store in the simplest of examples, but the reader is set up on the proxy. So, you can do something like:

    Code:
    new Ext.data.Store({
        fields: fields,
        data: xml,
        proxy: {
            type: 'memory',
            reader: {
                type: 'xml',
                record: repeatedStoreField
            }
        }
    });
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

    C
    heck out all of the 2013 SenchaCon presentations here:
    http://www.sencha.com/blog/senchacon...now-available/

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar