вот мой код, чтобы сохранить значения с помощью 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 работает, но text1 не работает, когда я послал значения от верхнего контроллера, чтобы сохранить durring debuuging я проверить формат Boths формат был тот же, что я должен сделать, чтобы синхронизировать значения, так что на стороне сервера получает их Updation
здесь формат в консоли отладки как для text1 и text2
CurrencyCode: 20
CurrencyName: "dollar"
CurrencySign: "$"
CurrencyStatus: "23"
DecimalPlaces: 1
NegativeFormat: "12"
PositiveFormat: "12"
__proto__: Object
код совершен я получаю значение валюты коды даже я редактировал вопрос теперь проверять комментарии –
почему это не aceepting код валюты их является только проблема с этим –