1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    3
    Vote Rating
    0
    eliothyj is on a distinguished road

      0  

    Default developed by using JsonWriter

    developed by using JsonWriter


    developed by using JsonWriter

    Hi there.I am working on a project that is developed by using JsonWriter.

    Here comes my codes:

    var reader = new Ext.data.JsonReader({
    root: 'rows',
    totalProperty: 'total',
    successProperty: 'success',
    idProperty: 'prg_no',
    fields: ['prg_no', 'prg_name', 'prg_spec', 'upduser', 'upddate', 'updtime']
    });

    var writer = new Ext.data.JsonWriter({
    encode: false,
    writeAllFields: true
    });

    var proxy = new Ext.data.DirectProxy({
    paramsAsHash: false,
    api: {
    read: doPci1102.readList,
    update: doPci1102.updateList,
    create: doPci1102.createList,
    destroy: doPci1102.destroyList
    }
    });

    var pci1102Ds = new Ext.data.DirectStore({
    batch: true,
    proxy: proxy,
    reader: reader,
    writer: writer,
    autoLoad: false,
    autoSave: false,
    listeners: {
    write : function(store, action, result, res, rs) {
    alert(action);
    },
    exception : function(proxy, type, action, options, res, arg) {
    alert(arg);
    }
    }
    });

    When using the "read" of the API, I can retrieve three correct records.
    But, after the data is modified, the result of the execution "pci1102Ds.save()"
    shows "{"action":"doPci1102","method":"updateList","data":["bas0001"],"type":"rpc","tid":5}" in firebug.
    the value of prg_no is "data":["bas0001"].
    If I change idProperty to prg_name ,and the result of "data":["basname"] doesn't contain all the six column data, but it would set writeAllFields: true.

    I have tried the following instructions:
    1.pci1102Ds.doTransaction('update', pci1102Ds.getAt(0));
    the result of "pci1102Ds.doTransaction('update', pci1102Ds.getAt(0));" in firebug shows {"action":"doPci1102","method":"updateList","data":["bas0001"],"type":"rpc","tid":5}
    2.pci1102Ds.doTransaction('create', pci1102Ds.getAt(0));
    the result of "pci1102Ds.doTransaction('create', pci1102Ds.getAt(0));" in firebug shows
    {"action":"doPci1102","method":"createList","data":[{"prg_no":"bas0001","prg_name":"basname","prg_spec":"test","upduser":"user","upddate":"981013","updtime":"22:30:54"}],"type":"rpc","tid":5}

    Would you please help me find where the problem is?? Thank you very much.

  2. #2
    Ext User
    Join Date
    Feb 2008
    Posts
    3
    Vote Rating
    0
    eliothyj is on a distinguished road

      0  

    Default


    It's useful and succeeded when I was using updateRecord to update data in JsonWriter.

    var reader = new Ext.data.JsonReader({
    root: 'rows',
    totalProperty: 'total',
    idProperty: 'prg_no',
    fields: ['prg_no', 'prg_name', 'prg_spec', 'upduser', 'upddate', 'updtime']
    });

    var writer = new Ext.data.JsonWriter({
    encode: false,
    writeAllFields: true,
    updateRecord: function(rec){
    doPci1102.updateList(rec.data);
    }
    });

    var pci1102Ds = new Ext.data.DirectStore({
    storeID: 'pci1102Ds',
    paramsAsHash: true,
    api: {
    read: doPci1102.readList,
    update: undefined,
    create: doPci1102.createList,
    destroy: doPci1102.destroyList
    },
    reader: reader,
    writer: writer,
    autoLoad: true,
    autoSave: false
    });

    Does this mean maybe there's some problem in 3.0.0 version?

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