dtotwai720621 2015-10-20 09:07
浏览 93
已采纳

Ext.grid.editorgrid - 如何只发送第一行编辑数据?

I´m stuck with this component. Every time I call the update script for the editorgrid, the data sent to the PHP is the first edited row, but if I edit a second row the data sent is the first row edited and the second row edited. If I edit a third one the case is the same, the data sent to the PHP is the first, second, and third edited rows. Is there a way to only send the data from the row edited?

Here is my code:

var MCompetidoresGrid = new Ext.grid.EditorGridPanel({
        store       : MCompetidoresStore,
        columns     : [
            MCompetidoresSm,
            {header:'id',               dataIndex:'id',         sortable: true, width:30,   },
            {header:'Empresa',          dataIndex:'id_empresa', sortable: true, width:120,  },
            {header:'CIF',              dataIndex:'cif',        sortable: true, width:120,  editor:MCompetidorestextField},  //NUEVO CAMPO 12-03-2015
            {header:'Acronimo',         dataIndex:'codigo',     sortable: true,  width:60,  editor:MCompetidorestextField},
            {header:'Competidor',       dataIndex:'nombre',     sortable: true, width:200,  editor:MCompetidorestextField},
            {header:'Descripcion',      dataIndex:'descripcion',sortable: true,  width:320, editor:MCompetidorestextField}
        ],
        sm          : MCompetidoresSm,
        border      : false,
        stripeRows  : true,
        viewConfig:{
            markDirty:false
        }
});

var MCompetidoresStore = new Ext.data.Store({
        id          : "id",
        proxy       : MCompetidoresProxy,
        reader      : MCompetidoresReader,
        writer      : MCompetidoresWriter,
        autoSave    : true
});

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

var MCompetidoresReader = new Ext.data.JsonReader({
        totalProperty   : 'total',
        successProperty : 'success',
        messageProperty : 'message',
        idProperty      : 'id',
        root            : 'data'
    },[
            {name: 'id'},
            {name: 'id_empresa'},
            {name: 'cif'},     
            {name: 'codigo'},
            {name: 'nombre'},
            {name: 'descripcion'},
    ]); 

var MCompetidoresProxy = new Ext.data.HttpProxy({
        api: {
            read    : "./Competenciaphp/MtoMaestro/getContacts.php"+"?"+"cliente="+despliegue,
            create  : "./Competenciaphp/MtoMaestro/createContact.php"+"?"+"cliente="+despliegue,
            update  : "./Competenciaphp/MtoMaestro/updateContact.php"+"?"+"cliente="+despliegue,                    
            destroy : "./Competenciaphp/MtoMaestro/destroyContact.php"+"?"+"cliente="+despliegue
        },
    }); 
  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥25 需要一个能在H5中实现扫码的插件
      • ¥50 ArcGIS或MATLAB实现批量计算整个tif图像的EVI
      • ¥20 两个板子之间CAN通信ID号怎么设置
      • ¥15 两个板子CAN通信的话ID号怎么设置
      • ¥15 ANSYS APDL循环结果输出
      • ¥15 ArcGIS处理MODIS 09数据,计算EVI 像元值大小问题
      • ¥15 Python库一直装不好
      • ¥30 在linux上调用海康SDK没有进入函数内
      • ¥15 FreeRTOS有任务卡死
      • ¥15 vue网页地址中的#问题