Dear to whom it may concern,
I have an igTree bound to a viewModel using Knockout and this is working well.
I am returning the viewModel to the server, by Ajax JSON Post to Web API (ASP.NET), on a Button Click event.
My problem is that when I delete nodes I think they are being removed from the viewModel that is being returned to the server.
Is there a way of marking the entries for delete, using the knockout '_destroy' field rather than deleting them from the viewModel (unless it already does this and I am missing something) and, if so, how do I use ASP.NET Web API to retrieve the viewModel including the _destroy property (I understand the latter is strictly not related to the igTree control but any help would be greatly appreciated)?
Many Thanks
Paul Fryer
Hi there,
The tree keeps a transaction log which you can use in order to delete the items on the server. The implementation however is to keep the data source (viewModel) and the current tree structure in sync, which means that upon deleting a node, the value is removed from the data source and is recorded in the transaction log.
http://help.infragistics.com/jQuery/2014.1/ui.igtree#methods:transactionLog
There is a blog post that shows you how to work with the transaction log.
Thank you for using the Infragistics forums!
Let me know if I may be of further assistance.
Hello,
Thank you for contacting us.
This is happening automatically. Currently it is not possible to set them as deleted and not to show them. The reason is that is bound to observable array.
You can try not to use observable and later to delete them from the data source.
References, regarding accessing data from a controller and getting current model in a controller, you can find below:
http://stackoverflow.com/questions/18048112/asp-mvc-4-get-current-model-in-controller
http://www.asp.net/mvc/tutorials/mvc-5/introduction/accessing-your-models-data-from-a-controller