I'm using an external button to start row editing. When a row is selected and I click the button, the popup editor will be displayed. Clicking "Cancel" the popup editor closes but the selected row will be removed. Whay?
I have created an example: http://dojo.telerik.com/@ralf.d-velop/orIme
What's wrong?
Regards,
Ralf
10 Answers, 1 is accepted
Hello Ralf,
The problem is caused by missing transport - read/update/create definition. Please check the following documentation article that will show you a basic scenarios how to implement them:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport
Regards,Kiril Nikolov
Telerik

so I have to define transport configuration when using local data also? And if so, how to define?
Regards,
Ralf
Hello Ralf,
Please check the following How To article as it might be helpful:
http://docs.telerik.com/kendo-ui/web/grid/how-to/grid-localstorage-crud
Regards,Kiril Nikolov
Telerik

thank you for information. I will change my code.
Maybe it's possible to implement some function to handle a kendo.observableHierarchy as data for the datasource and no transport configuration has to defined when using local data. And if it's possible to define the model/schema using MVVM, we have to write less code. The most prefered way is to bind only an observable array as datasource, defining columns and model/schema in MVVM way and the controls create their datasource self. Then we have to bind only the viewmodel and thats all :-)
Best regards,
Ralf

I have changed my code and added the transport configuration. But when clicking "Cancel" in the popup editor the selected row will be still removed. Here is my code: Cancel editing with transport is configured
I have tested also with kendo.observableHierarchy with same result: Cancel editing without tramsport
What I'm doing wrong?
Best regards,
Ralf
Hello Ralf,
I have tested your example, but was not able to reproduce the issue. Please check this screencast and let me know what I missed:
http://screencast.com/t/WSsmKEvy
Regards,Kiril Nikolov
Telerik

try click "Edit" and in the poup editor click "Cancel". Then the row will be removed. That's the problem.
Adding works, Changing data works, Cancel doesn't work. Why?
When using kendo.observableHierarchy without define transport config add new data works, edit and remove works. Cancel doesn't work. Why?
Best regards,
Ralf

I've found the problem. I've added the detail data as an field to the master data.
ar masterData = [
{RowID: kendo.guid(), Title:
"Master 1"
, Options: createOptionsData(1) },
{RowID: kendo.guid(), Title:
"Master 2"
, Options: createOptionsData(2) },
{RowID: kendo.guid(), Title:
"Master 3"
, Options: createOptionsData(3) }
];
function
createOptionsData(id) {
var
data = [
{RowID: kendo.guid(), Title:
"Master "
+ id +
" Option 1"
},
{RowID: kendo.guid(), Title:
"Master "
+ id +
" Option 2"
},
{RowID: kendo.guid(), Title:
"Master "
+ id +
" Option 3"
}
];
return
data;
}
When edit an option data entry and click "Cancel" the observable functions starting, and both grids will be actualized.
When removing the field from master data and assign the details of selected master entry as separate array all is working fine.
So maybe it's possible to add new data type like "Array", and handle changes to this array in a separate way, so the observable functions are not infect Add, Update, Cancel an Remove functions? It would by much easier to work with depended data.
Best regards,
Ralf
Hello Ralf,
You can always submit this as a feature request on UserVoice, so it will be considered for a future implementation. As for the problem you are right that with your approach you are passing the array, but not the configuration and I missed that - apologies.
Regards,Kiril Nikolov
Telerik

thank you for information. I will submit a feature request.
Best regards,
Ralf