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货币代码它们是货币代码值这只是一个问题 –