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
},
});