PDA

View Full Version : I cann't passing parameter using Ext.data.HttpProxy api



iori0758
26 Jun 2011, 5:35 PM
Hi,guy,I met a problem,It has disturbed me 3days,
I defined a store :


var proxy = new Ext.data.HttpProxy({
api: {
read : {
timeout : 180000,
url : "getsalesorderline?strPC_Order_ID="+strPC_Order_ID+"&mode=default",
method : 'POST'
},
create : {
timeout : 180000,
url : "EditSalesOrderLine",
method : 'POST',
params:{strPC_Order_ID: strPC_Order_ID,
cbpid: bpid,
//priceversion: Ext.getCmp('priceversion').getValue(),
cTaxId: cTaxId,
//strPCOrderLineId: e.record.get(e.field+'id'),
mWarehouseId: mWarehouseId,
dateOrdered: dateOrdered,
cBpartnerLocationId: cBpartnerLocationId,
datePromised: datePromised,
//style: e.record.get("??"),
//color: e.record.get("??"),
//price: e.record.get("??"),
//size: e.field,
//movementQty: movementQty,
//actiontype: actiontype
}
},
update: {
timeout : 180000,
url : "EditSalesOrderLine",
method : 'POST',
params:{strPC_Order_ID: strPC_Order_ID,
cbpid: bpid,
//priceversion: Ext.getCmp('priceversion').getValue(),
cTaxId: cTaxId,
//strPCOrderLineId: e.record.get(e.field+'id'),
mWarehouseId: mWarehouseId,
dateOrdered: dateOrdered,
cBpartnerLocationId: cBpartnerLocationId,
datePromised: datePromised,
//style: e.record.get("??"),
//color: e.record.get("??"),
//price: e.record.get("??"),
//size: e.field,
//movementQty: movementQty,
//actiontype: actiontype
}
},
destroy: {
timeout : 180000,
url : "EditSalesOrderLine",
method : 'POST',
params:{strPC_Order_ID: strPC_Order_ID,
cbpid: bpid,
//priceversion: Ext.getCmp('priceversion').getValue(),
cTaxId: cTaxId,
//strPCOrderLineId: e.record.get(e.field+'id'),
mWarehouseId: mWarehouseId,
dateOrdered: dateOrdered,
cBpartnerLocationId: cBpartnerLocationId,
datePromised: datePromised,

}
}
}
});
newStore = new Ext.data.Store
({
autoSave: false,
autoLoad: {params:{strPC_Order_ID: strPC_Order_ID,
cbpid: bpid,
//priceversion: Ext.getCmp('priceversion').getValue(),
cTaxId: cTaxId,
//strPCOrderLineId: e.record.get(e.field+'id'),
mWarehouseId: mWarehouseId,
dateOrdered: dateOrdered,
cBpartnerLocationId: cBpartnerLocationId,
datePromised: datePromised,

}},
proxy:proxy,
reader:new Ext.data.JsonReader({totalProperty:"totalPorperty",root:"root",fields:fields}),
//pruneModifiedRecords:true,
writer: new Ext.data.JsonWriter({
encode: true,
paramsAsHash: true,
//listful: false,
writeAllFields: false
})

});
but it just post a request to server without any parameter which I defined,and I have defined this writer's config 'writeAllFields' is false,why it posts all fields,where is wrong in my code?

aramaki
28 Jun 2011, 4:20 AM
try to replace params on baseParams property