我有一个小问题,这次我决定每次使用 Ext.grid.plugin.RowEditing 更新一行时都在 sql 中进行咨询,我将代码的一部分粘贴到我有问题的地方。
var gridTablaConsulta = Ext.create('Ext.grid.GridPanel', {
title:'Consulta Tabla lotes',
store: storeTabla,
columns: [
Ext.create('Ext.grid.RowNumberer'),
{text: "NRBE", width: 60, sortable: true, dataIndex: 'NRBE'},
{text: "APLIC", width: 60, sortable: true, dataIndex: 'APLIC'},
{text: "FORM", width: 60, sortable: true, dataIndex: 'FORM'},
{text: "VERFOR", width: 60, sortable: true, dataIndex: 'VERFOR'},
{text: "FECLOT", width: 60, sortable: true, dataIndex: 'FECLOT'},
{text: "HORLOT", width: 60, sortable: true, dataIndex: 'HORLOT'},
{text: "TIPPAPLO", width: 60, sortable: true, dataIndex: 'TIPPAPLO'},
{text: "TAMPAP", width: 60, sortable: true, dataIndex: 'TAMPAP'},
{text: "FECINIIM", width: 60, sortable: true, dataIndex: 'FECINIIM'},
{text: "FECINIOB", width: 60, sortable: true, dataIndex: 'FECINIOB'},
{text: "ESTLOT", width: 60, sortable: true, dataIndex: 'ESTLOT'},
{text: "TOTPAGGE", width: 60, sortable: true, dataIndex: 'TOTPAGGE'},
{text: "TOTPAGIM", width: 60, sortable: true, dataIndex: 'TOTPAGIM'},
{text: "DESLOT", width: 60, sortable: true, dataIndex: 'DESLOT'},
{text: "TIPDIF", width: 60, sortable: true, dataIndex: 'TIPDIF', editor: {xtype:'textfield', allowBlank:false}},
{text: "DIADIF", width: 60, sortable: true, dataIndex: 'DIADIF', editor: {xtype:'textfield', allowBlank:false} },
{text: "FECALT", width: 60, sortable: true, dataIndex: 'FECALT'},
{text: "FECMOD", width: 60, sortable: true, dataIndex: 'FECMOD'},
{text: "TERMOD", width: 60, sortable: true, dataIndex: 'TERMOD'},
{text: "HORMOD", width: 60, sortable: true, dataIndex: 'HORMOD'}
],
selType: 'rowmodel',
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 2
})
],
listeners: {
edit: function(e){
Ext.Ajax.request({
url: 'http://localhost:8080/MyMaver/ServletTablaLotes',
method: 'POST',
params: {
Funcionalidad: 'Modificar',
DPNrbe: Ext.getCmp('DPNrbe').getValue(),
DPAplic: Ext.getCmp('DPAplic').getValue(),
DPForm:Ext.getCmp('DPForm').getValue(),
DPVersFor: Ext.getCmp('DPVerFor').getValue(),
DPFecLot: Ext.getCmp('DPFecLot').getValue(),
DPHorLot: Ext.getCmp('DPHorLot').getValue(),
DPTippApl: Ext.getCmp('DPTippApl').getValue(),
DPTamPap: Ext.getCmp('DPTamPap').getValue(),
DPFecinIm: Ext.getCmp('DPFecinIm').getValue(),
DPFeciNio: Ext.getCmp('DPFeciNio').getValue(),
DPEstLot: Ext.getCmp('DPEstLot').getValue(),
DPTotPagge: Ext.getCmp('DPTotPagge').getValue(),
DPTotPagim: Ext.getCmp('DPTotPagim').getValue(),
DPDesLot: Ext.getCmp('DPDesLot').getValue(),
DPTipDif: Ext.getCmp('DPTipDif').getValue(),
DPDiaDif: Ext.getCmp('DPDiaDif').getValue(),
Entorno: Ext.getCmp('Entorno').getValue()
},
success: function(){
var text = response.responseText;
// process server response here
respuestaModificacion(text);
},
failure: function (){
alert("Desde failure");
},
exception: function (){
alert("Desde exception");
}
});
}
}
});
我的问题在于我必须在推送更新时保存我在 rox 中所做的更改。我认为这个 DPNrbe: Ext.getCmp('DPNrbe').getValue(), 是不正确的,但我必须在这里做正确的 sql 咨询。
即使没有更改阵营,我也需要保存该行的所有值,因为接下来我必须在 sql 中进行咨询(使用更改值进行更新)。
再次感谢大家。