1. #1
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    448
    Vote Rating
    21
    Zdeno will become famous soon enough Zdeno will become famous soon enough

      0  

    Default JsonStore with writer

    JsonStore with writer


    Hi, is possible to set different 'root' property for writer? As I see in source code, there is following line:

    Code:
    params[this.meta.root] = Ext.encode(data);
    I tried set up root but following lines does not solve my problem:

    Code:
    writer: new Ext.data.JsonWriter({
        encode: true,
        writeAllFields: false,
        root: 'records'
    })

  2. #2
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    448
    Vote Rating
    21
    Zdeno will become famous soon enough Zdeno will become famous soon enough

      0  

    Default


    *bump*

  3. #3
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    448
    Vote Rating
    21
    Zdeno will become famous soon enough Zdeno will become famous soon enough

      0  

    Default


    When i try help one guy here with problem i found following code in writer:

    Code:
    ...
    if(this.reader){ // reader passed
        if(!this.recordType){
            this.recordType = this.reader.recordType;
        }
        if(this.reader.onMetaChange){
            this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this);
        }
        if (this.writer) { // writer passed
            if (this.writer instanceof(Ext.data.DataWriter) === false) {    // <-- config-object instead of instance.
                this.writer = this.buildWriter(this.writer);
            }
            this.writer.meta = this.reader.meta;
            this.pruneModifiedRecords = true;
        }
    }
    ...
    Why you assign meta data from reader to writer? Then it isnt possible to assign different root to writer as it is in Ext 4.

  4. #4
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    448
    Vote Rating
    21
    Zdeno will become famous soon enough Zdeno will become famous soon enough

      0  

Tags for this Thread