Hi,
We are using a MVVM ListView with the edditing feature, following your example in the demo section. We've also added an "Add record" button in order to insert new records. Everything works fine, we can add and update items. But if we try to cancel the editing the item vanishes from the list.
This is how the add method looks like:
It was not possible to use the listView.add() method. When we tried this, Kendo always throws an exception "ProductName is not defined".
While debugging the kendo.web.js we've noticed that the "_pristineData" value is undefined / empty when iterating through the original items
Based on your demo we've created a fiddle in order to reproduce it.
How can we add the new items to the _pristineData? Are we missing something?
Thanks in advance,
Patrick
We are using a MVVM ListView with the edditing feature, following your example in the demo section. We've also added an "Add record" button in order to insert new records. Everything works fine, we can add and update items. But if we try to cancel the editing the item vanishes from the list.
This is how the add method looks like:
01.
addRecord:
function
(e)
02.
{
03.
console.log(
"addRecord"
);
04.
var
listView = $(
"#myTestList"
).data(
"kendoListView"
);
05.
listView.dataSource.insert(0, {
06.
"ProductID"
: Math.floor(Math.random()*100),
07.
"ProductName"
:
"test"
,
08.
"UnitPrice"
: 2,
09.
"UnitsInStock"
: 39,
10.
"Discontinued"
:
false
11.
});
12.
}
It was not possible to use the listView.add() method. When we tried this, Kendo always throws an exception "ProductName is not defined".
While debugging the kendo.web.js we've noticed that the "_pristineData" value is undefined / empty when iterating through the original items
1.
_eachPristineItem:
function
(callback)
2.
{
3.
this
._eachItem(
this
._pristineData, callback);
4.
}
Based on your demo we've created a fiddle in order to reproduce it.
How can we add the new items to the _pristineData? Are we missing something?
Thanks in advance,
Patrick