PDA

View Full Version : Update record loadData r is undefined



synkowski
26 Feb 2010, 2:13 AM
Hi all, :) I'm new, but I read this forum a few months

I have a problem with my store, and I can not solve it for a long time

my proxy

var proxywarehouseWindow = new Ext.data.HttpProxy({
api: {
read : 'http://10.0.0.72/index.php/configuration/warehouse/read',
create : 'http://10.0.0.72/index.php/configuration/warehouse/create',
update : 'http://10.0.0.72/index.php/configuration/warehouse/update',
destroy : 'http://10.0.0.72/index.php/configuration/warehouse/destroy',
},disableCaching:false,method: 'POST'
});
my reader

var readerwarehouseWindow = new Ext.data.JsonReader({
successProperty: 'success',
totalProperty:'totalCount',
idProperty: 'ID',
root: 'data'
}, [{name: 'ProductCheckOutConfirmation'},{name: 'ProductCheckInConfirmation'},{name: 'ProductCheckOutRemove'},{name: 'Manager'},{name: 'ProductMovementConfirmation'},{name: 'ProductAlocConfirmation'},{name: 'ProductPassConfirmation'},{name: 'ProductReturnConfirmation'},{name: 'ProductDestroyConfirmation'},{name: 'InvoiceIssueConfirmation'},{name: 'ProductUtilizationConfirmation'},{name: 'PublishOnTheInternet'},{name: 'LastAndFirstMode'},{name: 'LowLevelInfo'},{name: 'LowLevelEmail'},{name: 'LowLevelContact'},{name: 'LowLevelContactID'},{name: 'WarehouseType'},{name: 'DigitsAfterComma'},{name: 'DefaultPrintVoucher'},{name: 'DefaultPrintCheckoutDoc'},{name: 'PreviousDateTransactionAlowed'},{name: 'RemoveDocumentsAfterMonths'},{name: 'RemoveOrdersAfterMonths'},{name: 'DefaultForInternetOrders'},{name: 'lp'},{name: 'Name', allowBlank: false},{name: 'Street', allowBlank: false},{name: 'City', allowBlank: false},{name: 'Phone', allowBlank: false},{name: 'Email', allowBlank: false},{name: 'Description', allowBlank: false},{name: 'ID'}]);
my writer


var writerwarehouseWindow = new Ext.data.JsonWriter({
encode: true,
writeAllFields: true

});
my store

var storewarehouseWindow = new Ext.data.Store({

restful: false,
proxy: proxywarehouseWindow,
reader: readerwarehouseWindow,
writer: writerwarehouseWindow,
sortInfo:{field: 'lp', direction: 'ASC'},


});




And I set my data to this store through an external form

This is his handler

handler: function()
{
var response = addPanel.getForm().submit(
{
url:url
,waitMsg:'Zapisywanie danych...',
success: function(formu,action){
var form = addPanel.getForm(); warehouseWindow.hide();
debugger;


storewarehouseWindow.loadData(action.result,true);

form.reset();
App.setAlert(true, 'Wiadomo?? z serwera', 'Zmienione dane zosta?y zapisane',1);
},failure: function(){
App.setAlert('false', 'Wiadomo?? z serwera', 'Wyst?pi? b??d zapisu danych!!! Dane nie zosta?y zapisane.',3);
}});
}
}And when I add a new record everything is okay
this is response


{"success":true,"message":"Created new row","totalCount":false,"data":[{"lp":12,"ID":"57","Name":"gfgggg","Description":"","Street":"","Manager":null,"Email":"","Phone":"","City":"","PublishOnTheInternet":"0","LowLevelInfo":"0","LowLevelEmail":null,"LowLevelContact":null,"LowLevelContactID":"0","WarehouseType":null,"LastAndFirstMode":"0","DigitsAfterComma":"0","ProductCheckInConfirmation":"0","ProductCheckOutConfirmation":"0","ProductCheckOutRemove":"0","ProductMovementConfirmation":"0","ProductAlocConfirmation":"0","ProductPassConfirmation":"0","ProductReturnConfirmation":"0","ProductDestroyConfirmation":"0","InvoiceIssueConfirmation":"0","ProductUtilizationConfirmation":"0","DefaultPrintVoucher":"0","DefaultPrintCheckoutDoc":"0","PreviousDateTransactionAlowed":"0","RemoveDocumentsAfterMonths":"72","RemoveOrdersAfterMonths":"6","DefaultForInternetOrders":"0","idUser":"106"}]}


but when I update the record I get an error

r is undefined

please help

synkowski
2 Mar 2010, 3:58 AM
Hi, I still can not find a solution
This script break down in
http://images44.fotosik.pl/267/a92bca42ce3614a4.jpg