0
是我的代碼使用JS來保存值無法讀取未定義的數據?這裏JSON
self.Save = function (e) {
if (vm_Currencies.selectedRow.CurrencyName == null) {
alert("Fill Some Thing");
}
if (vm_Currencies.selectedRow.CurrencyCode != null) {
debugger;
var text1 = { "CurrencyCode": vm_Currencies.selectedRow.CurrencyCode, "CurrencyName": vm_Currencies.selectedRow.CurrencyName, "CurrencySign": vm_Currencies.selectedRow.CurrencySign, "DecimalPlaces": vm_Currencies.selectedRow.DecimalPlaces, "PositiveFormat": vm_Currencies.selectedRow.PositiveFormat, "NegativeFormat": vm_Currencies.selectedRow.NegativeFormat, "CurrencyStatus": vm_Currencies.selectedRow.CurrencyStatus };
self.dsProduct.add(text1);
///////////error comes here while i call sync()
self.dsProduct.sync();
////cannot read data of undefined
}
if (e.data.CurrencyName != null) {
debugger;
var text2 = { "CurrencyName": e.data.CurrencyName, "CurrencySign": e.data.CurrencySign, "DecimalPlaces": e.data.DecimalPlaces, "PositiveFormat": e.data.PositiveFormat, "NegativeFormat": e.data.NegativeFormat, "CurrencyStatus": e.data.CurrencyStatus };
self.dsProduct.add(text2);
/////////sucess
self.dsProduct.sync();
/////sucess
}
}
text2的工作,但文本1不工作時,我發送的值頂部控制器以節約durring debuuging我檢查格式boths格式是相同的我應該怎麼做同步的值,使服務器端接收他們更新用
這裏是兩個文本1和文本
CurrencyCode: 20
CurrencyName: "dollar"
CurrencySign: "$"
CurrencyStatus: "23"
DecimalPlaces: 1
NegativeFormat: "12"
PositiveFormat: "12"
__proto__: Object
的代碼是完美的,我得到即使我已經編輯現在確認問題的意見 –
這是爲什麼不aceepting貨幣代碼它們是貨幣代碼值這只是一個問題 –