1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    30
    Vote Rating
    0
    borillo is on a distinguished road

      0  

    Default Problem with GridPanel and RowEditor with a restful Store

    Problem with GridPanel and RowEditor with a restful Store


    Hi all,

    I'm using ExtJS 3.2.1 and I have this store definition:

    var store = new Ext.data.Store( {
    url : '/x/y/z',
    restful: true,
    reader : new Ext.data.XmlReader( {
    record : 'data',
    id : 'id',
    totalRecords : '@total'
    }, [ 'id', { name: 'objid', mapping: 'mydata/id' }, 'name', 'type' ]),
    writer : new Ext.data.XmlWriter({
    writeAllFields : true
    })
    });

    This is nicely showed in my GridPanel.

    This GridPanel uses the Ext.ux.grid.RowEditor as a plugin.

    When i try to update a row in the GridPanel with the RowEditor and clic "Update", the following error is thrown in my firebug:

    """
    PUT /x/y/z/1 400 Bad Request

    XML
    Error de lectura XML: mal formado Ubicación: moz-nullprincipal:{9334c4bb-7beb-4a2c-a78b-da1ca99067b0} Número de línea 1, columna 80:
    ...ISO-8859-15"?><data><id>4</id><mydata/id>1</mydata/id><name>F...
    ...-------------------------------------------------^
    Source
    <?xml version="1.0" encoding="ISO-8859-15"?><data><id>4</id><mydata/id>1</mydata/id><name>x</name><type>text/xml</type></data>"""

    It seems like the mapping information from the store definition is used instead of the name.

    Any ideas?

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Feb 2008
    Posts
    30
    Vote Rating
    0
    borillo is on a distinguished road

      0  

    Default


    Hi again,

    I find the problem in DataWriter.js (line 177):

    Ext.iterate(raw, function(prop, value){
    if((m = map[prop])){
    data[m.mapping ? m.mapping : m.name] = value;
    }
    });

    If i change the internal line and remove mapping reference, all works:

    data[m.name] = value;

    Is this a bug or i'm missing something?

    Thanks again

    Regards,
    Ricardo

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    30
    Vote Rating
    0
    borillo is on a distinguished road

      0  

    Default


    Hi again,

    Please, Can somebody review this issue? It looks like a bug in DataWriter ...

    Best regards,
    Ricardo