1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    pborissow is on a distinguished road

      0  

    Default Saving Model with Nested Data

    Saving Model with Nested Data


    Hello-
    I'm relatively new to ExtJS 4 and I'm trying to wrap my head around Models. Everything is pretty straightforward so far except saving models - specifically models with nested data (associations). I have a "Contact" model with three associations: "Phone", "Email", and "Address".

    Code:
     
    
      //**************************************************************************
      //** Phone
      //**************************************************************************
      /** Used to represent a contact's phone number. */
    
        Ext.define('Phone', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'number',    type: 'string'},
                {name: 'type',      type: 'string'}
            ]
        });
    
    
    
      //**************************************************************************
      //** Address
      //**************************************************************************
      /** Used to represent a contact's physical address. */
    
        Ext.define('Address', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'type',          type: 'string'},
                {name: 'street',        type: 'string'},
                {name: 'city',          type: 'string'},
                {name: 'state',         type: 'string'},
                {name: 'postalCode',    type: 'string'}
            ]
        });
    
    
      //**************************************************************************
      //** Email
      //**************************************************************************
      /** Used to represent a contact's email address. */
    
        Ext.define('Email', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'address',   type: 'string'}
            ],
            validations: [
                {type: 'format', field: 'address', matcher: /[a-z]@[a-z].com/}
            ]
        });
    
      //**************************************************************************
      //** Contact
      //**************************************************************************
      /** Used to represent an individual or company. */
    
        Ext.define('Contact', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'id',        type: 'int'},
                {name: 'firstname', type: 'string'},
                {name: 'lastname',  type: 'string'},
                {name: 'fullname',  type: 'string'},
                {name: 'title',     type: 'string'},
                {name: 'company',   type: 'string'},
                {name: 'gender',    type: 'string'},
                {name: 'dob',       type: 'date'}
            ],
            hasMany: [
                {model: 'Phone',   name: 'phone'},
                {model: 'Email',   name: 'email'},
                {model: 'Address', name: 'address'}
            ]
        });
    When I try to save the contact via a proxy, the nested data doesn't make it to the server. Example:

    Code:
    var contact = new Contact();
    contact.set("firstname", "John");
    contact.set("lastname", "Doe");
    
    var addresses = [];
    var address = new Address();
    address.set("type", "Business");
    address.set("city", "New York");
    address.set("state", "NY");
    address.set("postalCode", "10004");
    addresses.push(address);
    
    address = new Address();
    address.set("type", "Home");
    address.set("city", "Brooklyn");
    address.set("state", "NY");
    address.set("postalCode", "11201");
    addresses.push(address);
    
    contact.set("address", addresses);
    
    contact.setProxy(new Ext.data.proxy.Ajax({
        url: '/WebServices/SaveContact',
        reader: {
            type: 'json'
        }
    }));
    
    contact.save({
        success: function() {                    
            //Do something
        },
        failure: function() {
            //Notify user
        }
    });
    In this example, the "firstname" and "lastname" are sent to the server but the "address" is not.

    Code:
    {
        "id":0,
        "firstname":"John",
        "lastname":"Doe",
        "fullname":"",
        "title":"",
        "company":"",
        "gender":"",
        "dob":null
    }

    I found this thread on the forums that's somewhat related:
    http://www.sencha.com/forum/showthre...w-data-package

    In the thread "blee" posted code for a custom writer ("custom.writer.Json"). With blee's custom writer ("custom.writer.Json") I was able to see the associated data being passed to the server. Unfortunately in my case, the arrays were empty. Example:

    Code:
    {
        "id":0,
        "firstname":"John",
        "lastname":"Doe",
        "fullname":"",
        "title":"",
        "company":"",
        "gender":"",
        "dob":null,
        "address":[],
        "phone":[],
        "email":[]
    }

    I ended up writing a new method called setAssociatedData() and I bolted it onto the Model class via a prototype:

    Code:
        Ext.data.Model.prototype.setAssociatedData = function(fieldName, value) {
    
            var associatedStore;
            var storeName;
            var associations = this.associations.items;
            for (var i=0; i<associations.length; i++){
                var association = associations[i];
                storeName = association.storeName;
    
                if (association.name==fieldName){
                    associatedStore = this[storeName];
                    if (associatedStore==null){
                        this[storeName] = associatedStore =
                            Ext.create('Ext.data.Store', {
                            model: association.model
                        })
                    }
                    break;
                }
            }
    
            if (associatedStore){
                associatedStore.add(value);
                this[storeName] = associatedStore;
            }
        }
    With this function, along with blee's custom writer, I am now able to save the nested data.

    Code:
    var contact = new Contact();
    contact.set("firstname", "John");
    contact.set("lastname", "Doe");
    
    var addresses = [];
    var address = new Address();
    address.set("type", "Business");
    address.set("city", "New York");
    address.set("state", "NY");
    address.set("postalCode", "10004");
    addresses.push(address);
    
    address = new Address();
    address.set("type", "Home");
    address.set("city", "Brooklyn");
    address.set("state", "NY");
    address.set("postalCode", "11201");
    addresses.push(address);
    
    contact.setAssociatedData("address", addresses);  //<--My new method
    
    Ext.define('custom.writer.Json', {
    extend: 'Ext.data.writer.Json',
        getRecordData: function(record) {
            Ext.apply(record.data, record.getAssociatedData());
            return record.data;
        }
    });
    
    contact.setProxy(new Ext.data.proxy.Ajax({
        url: '/WebServices/SaveContact',
        reader: {
            type: 'json'
        }
        ,writer: new custom.writer.Json({writeAllFields: true}) //<--blee's custom writer
    }));
    
    contact.save();

    Returns:
    Code:
    {
        "id":0,
        "firstname":"John",
        "lastname":"Doe",
        "fullname":"",
        "title":"",
        "company":"",
        "gender":"",
        "dob":null,
        "phone":[],
        "email":[],
        "address":[
            {"type":"Business","street":"","city":"New York","state":"NY","postalCode":"10004"},
            {"type":"Home","street":"","city":"Brooklyn","state":"NY","postalCode":"11201"}
        ]
    }

    So I have something that works for me but it doesn't seem right. Is there a more straightforward way to save a model with nested data?

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,266
    Vote Rating
    80
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    pborissow is on a distinguished road

      0  

    Default


    Thanks for the link ssamayoa. Unfortunately, it didn't quite work for me. When I add the overrides and call set() on the addresses, none of the addresses come across the wire. In other words, I still need the setAssociatedData() method for the address array.

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    30
    Vote Rating
    0
    diovani is on a distinguished road

      0  

    Lightbulb Simple solution to save()

    Simple solution to save()


    I was needing a simplest solution, just to send related model data to the server.
    So, this is what I came to.

    PHP Code:
    /**
     * 
     */
    Ext4.define('GV.model.BaseModel', {
        
    extend'Ext4.data.Model',
        
        
    /**
         * Persiste as associações, hasMany e belongsTo, para a base, enviando pelo proxy
         * @cfg {Boolean}
         */
        
    persistAssociationsfalse,
        
        
    idProperty'codigo',
        
        
    save: function() {
            var 
    me this;
            
    /*
             * Define valor dos campos relativos às associações
             */
            
    if (me.persistAssociations) {
                
    me.setme.getAssociatedData() );
            }
            
    me.callParent(arguments);
        }
    }); 
    This could be done as an override, also, to apply to any Model in application.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    punitoza1 is on a distinguished road

      0  

    Default Thanks pborrisow

    Thanks pborrisow


    Thanks pborrisow for posting such a detailed explanation. After an entire day, I was able to make nested models save work with the help of your code. But am still shocked that ExtJS doesn't provide this solution in their releases.

  6. #6
    Sencha User
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    wha is on a distinguished road

      0  

    Default Uncaught RangeError: Maximum call stack size exceeded

    Uncaught RangeError: Maximum call stack size exceeded


    Hi all, Now i defined blee custom writer, and trying to post nested model.
    But the error 'Uncaught RangeError: Maximum call stack size exceeded' occured when save.
    Here is my code.
    That's the Header model.
    Code:
    Ext.define('ipos.model.MenuCheckDetails', {
        extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                    'syskey',
                    'autokey',
                    'createdDate',
                    'modifiedDate',
                    'userid',
                    'userName',
                    'territoryCode',
                    'salesCode',
                    'projectCode',
                    'refCode1',
                    'refCode2',
                    'refCode3',
                    'refCode4',
                    'refCode5',
                    'refCode6',
                    'parentId',
                    'recordStatus',
                    'syncStatus',
                    'syncBatch',
                    'manualLineNo',
                    'stockCode',
                    'description',
                    'costCurCode',
                    'purCurCode',
                    'salesCurCode',
                    'stkSK',
                    'whSK',
                    'binSK',
                    'r1',
                    'subgroup',
                    'qty',
                    'lvl',
                    'lvlQty',
                    'currentQty',
                    'floorQty',
                    'aCost',
                    'sCost',
                    'purPrice',
                    'salePrice',
                    'costCurRate',
                    'purCurRate',
                    'salesCurRate',
                    'priceVariance',
                    'unitDiscount',
                    'totalDiscountAmount',
                    'lineDiscountAmount',
                    'distributedDiscountAmount',
                    'taxAmount',
                    'discountType',
                    'priceVaraingAccSK',
                    'stkAccSK',
                    'AccurualAccSK',
                    'cosAccSK',
                    'discountAccSK',
                    'taxAccSK',
                    'isCalculatedDiscountOnAmount',
                    'isCOGSPost',
                    'servicechargesSysKey',
                    'totalAmount',
                    'taxCodeSK',
                    'isTaxInclusive',
                    'taxPercent',
                    'beforeTaxAmount',
                    'skipPosting',
                    'openItem',
                    'mainItemType',
                    'subItemType',
                    'printKitchenCount',
                    'sellingUnitRatio',
                    'sellingUnitOperator',
                    'sellingPriceUnitLevel',
                    'sellingPriceUnitRatio',
                    'sellingPriceOperator',
                    'stockBaseRatio',
                    'stockBaseOperator',
                    'levelCost',
                    'levelPrice',
                    'levelDescription',
                    'OtherDescription',
                    'recommandPrice',
                    'currentLvlQty',
                    'floorLvlQty',
                    'discountPercent',
                    'itemStatus',
                    'isTakeAway',
                    'itemType',
                    'scAmount',
                    'isWaivedSC',
                    'isWaivedTax',
                    'pluSK',
                    'refDetailsSKSetMenuChildItem',
                    'sendOrderBy',
                    'description2',
                    'description3',
                    'discountDescription',
                    'pluCode',
                    'sentOrderTime',
                    'printerList',
                    'isOpenDiscount',
                    'voucherNumber',
                    'tableNo',
                    'tableSysKey',
            ],
             hasMany: {
                  model: "ipos.model.CheckDetailsModifiers",
                  name: "checkDetailsModifiers",
                  associationKey: "checkDetailsModifiers"
            },
            proxy: {
                type: 'ajax',
                disableCaching: false,
                url:'http://192.168.1.77:7070/iposservice/rest/Check/',
            }
    
    
        },
    });
    And that's the Details Model
    Code:
    Ext.define('ipos.model.CheckDetailsModifiers', {
        extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                'syskey',
                'autokey',
                'createdDate',
                'modifiedDate',
                'userId',
                'userName',
                'parentId',
                'recordStatus',
                'syncStatus',
                'syncBatch',
                'lineNo',
                'modifiersk',
                'modifierType',
                'priceOperator',
                'price',
                'modifierCode',
                'descritpion1',
                'description2',
                'description3',
                'modLUKPLU ',
            ],
            belongsTo: "ipos.model.MenuCheckDetails",    
        },
        
    });
    That's custom writer.
    Code:
    Ext.define('custom.writer.Json', {
                extend: 'Ext.data.writer.Json',
                getRecordData: function(record) {
                    Ext.apply(record.data, record.getAssociatedData());
                    return record.data;
                }
    });
    And set the custom writer to model.
    Code:
    var customWriter = new custom.writer.Json({writeAllFields: true});
    menuCheckDetailsRecord.getProxy().setWriter(customWriter);
    var checkDetailsModifierRecord = Ext.create('ipos.model.CheckDetailsModifiers', {
                        syskey: 0,
                        autokey: 0,
                        createdDate: ipos.app.getCurrentDateMIT(),
                        modifiedDate: ipos.app.getCurrentDateMIT(),
                        userId: 'wha',
            });
    menuCheckDetailsRecord.checkDetailsModifiers().add(checkDetailsModifierRecord);
    When i save this model, 'Uncaught RangeError: Maximum call stack size exceeded' is occured.
    Please help me and suggest me what i wrong, it takes me two days long, i didn't solve this . My goal is posting header details model to server. And i'm using sencha touch 2.1.1.

  7. #7
    Sencha User
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    wha is on a distinguished road

      0  

    Default Now i got it.

    Now i got it.


    Dear All,
    Now i got the header details model send to the server.
    I fixed some code and don't use custom writer.
    I also add detailed properties in model, like this

    {name:'checkDetailsModifiers', persist:true},

    Here is my my code.
    For Header Model
    Code:
    Ext.define('ipos.model.MenuCheckDetails', {
        extend: 'Ext.data.Model',
        
        config: {
            fields: [
                    'syskey',
                    'autokey',
                    'createdDate',
                    'modifiedDate',
                    'userid',
                    'userName',
                    'territoryCode',
                    'salesCode',
                    'projectCode',
                    'refCode1',
                    'refCode2',
                    'refCode3',
                    'refCode4',
                    'refCode5',
                    'refCode6',
                    'parentId',
                    'recordStatus',
                    'syncStatus',
                    'syncBatch',
                    'manualLineNo',
                    'stockCode',
                    'description',
                    'costCurCode',
                    'purCurCode',
                    'salesCurCode',
                    'stkSK',
                    'whSK',
                    'binSK',
                    'r1',
                    'subgroup',
                    'qty',
                    'lvl',
                    'lvlQty',
                    'currentQty',
                    'floorQty',
                    'aCost',
                    'sCost',
                    'purPrice',
                    'salePrice',
                    'costCurRate',
                    'purCurRate',
                    'salesCurRate',
                    'priceVariance',
                    'unitDiscount',
                    'totalDiscountAmount',
                    'lineDiscountAmount',
                    'distributedDiscountAmount',
                    'taxAmount',
                    'discountType',
                    'priceVaraingAccSK',
                    'stkAccSK',
                    'AccurualAccSK',
                    'cosAccSK',
                    'discountAccSK',
                    'taxAccSK',
                    'isCalculatedDiscountOnAmount',
                    'isCOGSPost',
                    'servicechargesSysKey',
                    'totalAmount',
                    'taxCodeSK',
                    'isTaxInclusive',
                    'taxPercent',
                    'beforeTaxAmount',
                    'skipPosting',
                    'openItem',
                    'mainItemType',
                    'subItemType',
                    'printKitchenCount',
                    'sellingUnitRatio',
                    'sellingUnitOperator',
                    'sellingPriceUnitLevel',
                    'sellingPriceUnitRatio',
                    'sellingPriceOperator',
                    'stockBaseRatio',
                    'stockBaseOperator',
                    'levelCost',
                    'levelPrice',
                    'levelDescription',
                    'OtherDescription',
                    'recommandPrice',
                    'currentLvlQty',
                    'floorLvlQty',
                    'discountPercent',
                    'itemStatus',
                    'isTakeAway',
                    'itemType',
                    'scAmount',
                    'isWaivedSC',
                    'isWaivedTax',
                    'pluSK',
                    'refDetailsSKSetMenuChildItem',
                    'sendOrderBy',
                    'description2',
                    'description3',
                    'discountDescription',
                    'pluCode',
                    'sentOrderTime',
                    'printerList',
                    'isOpenDiscount',
                    'voucherNumber',
                    'tableNo',
                    'tableSysKey',
                    {name:'checkDetailsModifiers', persist:true},
            ],
             hasMany: {
                  model: "ipos.model.CheckDetailsModifiers",
                  name: "checkDetailsModifiers",
                  associationKey: "checkDetailsModifiers"
            },
            proxy: {
                type: 'ajax',
                disableCaching: false,
                url:'http://122.248.233.68:7070/iposservice/rest/Check/',
                writer: {
                    type: 'json',
                    writeAllFields: true
                }
    
    
            },
        },
    });
    And nothing to change detailed model.

    I used this code for adding detailed models to header model.
    Code:
     addModifiersToCheckDetailsRecord: function(checkDetailsRecord) {
            var modifiersyskeylist = this.getModiferValue();
            var modifierSysKeyArray = modifiersyskeylist.split(',');
            var topperStore = this.getModifierStore();
    
    
            var modifierArr = new Array();
    
    
            if (modifierSysKeyArray.length > 0) {
              
                for (var i=0; i<modifierSysKeyArray.length; i++) {
                    var record = topperStore.findRecord('syskey', modifierSysKeyArray[i]);
                    var checkDetailsModifierRecord = this.prepareCheckDetailsModifier(record);
                    modifierArr.push(checkDetailsModifierRecord.data);
                }
                checkDetailsRecord.set("checkDetailsModifiers", modifierArr);
            }
            return checkDetailsRecord;
        },
    Remember that i used array.push(detailedRecord.data) instead of headerModel.detailsModel().add(detailRecord).

    For e.g.,
    modifierArr.push(checkDetailsModifierRecord.data);
    instead of
    checkDetailsRecord.modifiers().add(checkDetailsModifierRecord);

    Here is my json data when i adding this code and submit to the service.
    Code:
    {
    "accurualAccSK":"0",
    "autokey":"0",
    "beforeTaxAmount":"45.0",
    "binSK":"0",
    "checkDetailsModifiers":[
    {
    "autokey":"0",
    "createdDate":"20130303",
    "description1":"底",
    "description2":"",
    "description3":"",
    "lineNo":"1",
    "modLUKPLU":"",
    "modifiedDate":"20130303",
    "modifierCode":"",
    "modifierType":"0",
    "modifiersk":"0",
    "parentId":"0",
    "price":"0.0",
    "priceOperator":"3",
    "recordStatus":"1",
    "syncBatch":"1",
    "syncStatus":"1",
    "syskey":"0",
    "userId":"01",
    "userName":"01"
    },
    {
    "autokey":"0",
    "createdDate":"20130303",
    "description1":"芥蘭",
    "description2":"",
    "description3":"",
    "lineNo":"1",
    "modLUKPLU":"",
    "modifiedDate":"20130303",
    "modifierCode":"",
    "modifierType":"0",
    "modifiersk":"0",
    "parentId":"0",
    "price":"0.0",
    "priceOperator":"3",
    "recordStatus":"1",
    "syncBatch":"1",
    "syncStatus":"1",
    "syskey":"0",
    "userId":"01",
    "userName":"01"
    },
    {
    "autokey":"0",
    "createdDate":"20130303",
    "description1":"芥蘭仔",
    "description2":"",
    "description3":"",
    "lineNo":"1",
    "modLUKPLU":"",
    "modifiedDate":"20130303",
    "modifierCode":"",
    "modifierType":"0",
    "modifiersk":"0",
    "parentId":"0",
    "price":"0.0",
    "priceOperator":"3",
    "recordStatus":"1",
    "syncBatch":"1",
    "syncStatus":"1",
    "syskey":"0",
    "userId":"01",
    "userName":"01"
    }
    ],
    "cosAccSK":"0",
    "costCurCode":"",
    "costCurRate":"0.0",
    "createdDate":"",
    "currentLvlQty":"0.0",
    "currentQty":"0.0",
    "description":"DB ChknSp/B.Abalone",
    "description2":"鮑魚仔燉雞湯",
    "description3":"",
    "discountAccSK":"0",
    "discountDescription":"",
    "discountPercent":"0.0",
    "discountType":"0",
    "distributedDiscountAmount":"0.0",
    "floorLvlQty":"0.0",
    "floorQty":"0.0",
    "headerAmount":"0.0",
    "isCOGSPost":"0",
    "isCalculatedDiscountOnAmount":"0",
    "isOpenDiscount":"0",
    "isTakeAway":"0",
    "isTaxInclusive":"0",
    "isWaivedSC":"0.0",
    "isWaivedTax":"0.0",
    "itemStatus":"0",
    "itemType":"0",
    "levelCost":"0.0",
    "levelDescription":"",
    "levelPrice":"0.0",
    "lineDiscountAmount":"0.0",
    "lvl":"0",
    "lvlQty":"0.0",
    "mainItemType":"0",
    "manualLineNo":"1",
    "modifiedDate":"20130303",
    "openItem":"0",
    "otherDescription":"",
    "parentId":"27",
    "pluCode":"0202",
    "pluSK":"22",
    "priceVaraingAccSK":"0",
    "priceVariance":"0.0",
    "printKitchenCount":"0",
    "printerList":"0",
    "projectCode":"0",
    "purCurCode":"",
    "purCurRate":"0.0",
    "purPrice":"0.0",
    "qty":"1.0",
    "r1":"0",
    "recommandPrice":"0.0",
    "recordStatus":"1",
    "refCode1":"0",
    "refCode2":"0",
    "refCode3":"0",
    "refCode4":"0",
    "refCode5":"0",
    "refCode6":"0",
    "refDetailsSKSetMenuChildItem":"0",
    "salePrice":"15.0",
    "salesCode":"0",
    "salesCurCode":"",
    "salesCurRate":"0.0",
    "scAmount":"0.0",
    "sellingPriceOperator":"",
    "sellingPriceUnitLevel":"0",
    "sellingPriceUnitRatio":"0.0",
    "sellingUnitOperator":"",
    "sellingUnitRatio":"0.0",
    "sendOrderBy":"0",
    "sentOrderTime":"",
    "servicechargesSysKey":"0",
    "skipPosting":"0",
    "stkAccSK":"0",
    "stkSK":"1212271401594300630",
    "stockBaseOperator":"",
    "stockBaseRatio":"0.0",
    "stockCode":"",
    "subItemType":"0",
    "subgroup":"0",
    "syncBatch":"0",
    "syncStatus":"0",
    "syskey":"30",
    "tableNo":"001",
    "tableSysKey":"2",
    "taxAccSK":"0",
    "taxAmount":"0.0",
    "taxCodeSK":"0",
    "taxPercent":"0.0",
    "territoryCode":"0",
    "totalAmount":"45.0",
    "totalDiscountAmount":"0.0",
    "unitDiscount":"0.0",
    "userName":"01",
    "userid":"01",
    "voucherNumber":"",
    "whSK":"0",
    "aCost":"0.0",
    "sCost":"0.0"
    }

  8. #8
    Sencha User swellbow's Avatar
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    swellbow is on a distinguished road

      0  

    Default


    We've been using the custom writer approach for a while, and it works well. I did find that if you need to pass any extra writer configs, such as nameProperty: 'mapping', those would not get applied. I amended the writer as follows and have found it works for persisting associated collections as it did before but now with the ability to customize the writer's underlying inheritance hierarchy.

    Code:
        Ext.define('custom.writer.JsonExtended', {
            extend: 'Ext.data.writer.JsonExtended',
            alias: 'writer.json-custom-writer-extended',
    
    
            constructor: function(config) {
                this.callParent(arguments);
            },
    
    
            getRecordData: function (record, operation) {
                record.data = this.callParent(arguments);
                Ext.apply(record.data, record.getAssociatedData());
                return record.data;
            }
        });
    Note you can instantiate these in your model as an xtype:

    Code:
    writer: { 
                    type: 'json-custom-writer-extended',
                    writeAllFields: true,
                    nameProperty: 'mapping' 
                },

  9. #9
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
    rupamkhaitan is on a distinguished road

      0  

    Default how to save nested data when using rest proxy

    how to save nested data when using rest proxy


    any code ?