问题
I have this code: http://jsfiddle.net/nickbuus/82q8j/11/
When I press edit on the "row" and then update I am updating the data on the server and then reloading all of the rows using:
GetFoods('catname');
I am using knockoutjs - is there a clever way to connect and update the particular row in the list that was edited without having to reload all of the rows on update?
回答1:
On the ApiController, you should add three new methods
- Create a new item
- Update existing item
- Get info of a specific item
With these methods you will be able to do what you are looking for. I also suggest you to have a look at knockout.mapping and more specifically at the ko.mapping.fromJS and toJS functions.
来源:https://stackoverflow.com/questions/16999035/ability-to-update-list-without-reloading-it-when-editing-a-row-using-knockoutjs