You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if using arraychange event on selectedFlightViewModels it seem to firing a added/deleted event of the same item when a property observable in the DataSetItemViewModel is changed.
Is this intended?
no array changed events fired on selectedFlights so its only happening when I change something on the DataSetItemViewModel and I am trying to get around that because it flushes all the UI bindings
The text was updated successfully, but these errors were encountered:
Yes, if your mapping function evaluates an observable, then the only way Knockout-Projections can update the mapping output is to remove the old item and add a newer version of it with the updated observable value.
If you don't want that to happen, then make sure the observable dependency is scoped to the DataSetItemViewModel object itself. For example, don't write this:
function DataSetItemViewModel(flight) {
this.price = flight.price();
}
Instead, write either this:
function DataSetItemViewModel(flight) {
this.price = flight.price;
}
Or this, if you need to apply some transformation to the incoming data:
With either of these latter two code blocks, the subscription on the price observable is not an aspect of the mapping - it's scoped within the DataSetItemViewModel.
I have chained some arrays like this:
if using arraychange event on selectedFlightViewModels it seem to firing a added/deleted event of the same item when a property observable in the DataSetItemViewModel is changed.
Is this intended?
no array changed events fired on selectedFlights so its only happening when I change something on the DataSetItemViewModel and I am trying to get around that because it flushes all the UI bindings
The text was updated successfully, but these errors were encountered: