knockout.mapping icon indicating copy to clipboard operation
knockout.mapping copied to clipboard

Updating array mapped via the mapping plugin replaces the contents of the array.

Open vishnurk opened this issue 11 years ago • 0 comments

This is more of a question -

I have an object in my view model that gets updated with array data from the server using the mapping plugin.

Contents of the mapped observable array are displayed in a table. Now, the user has the capability to 'load more', which triggers a request to the server and gets the next 'n' rows of data from the server.

Updating the view model object using the mapping plugin with new data causes the existing data to be replaced. My goal is to make the mapping plugin append the new data to the existing observable array.

Wondering if this is possible using a custom 'create' or an 'update' callback? If yes, some examples would really help.

For now, as a workaround - I've resorted to manually pushing data into the view model object.

vishnurk avatar Jan 23 '14 21:01 vishnurk