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
I am sorry I can't find any issue about this problem. If there was, please tell me. Thanks very much : ).
My problem is that I want to get the item from an observableArray by index, and when in the html, just like data-bind=“with:ColumnInfo()[Index]”, the array could not update after having modified the value of array item. I think the reason may be that ColumnInfo()[Index] is not longer an item belongs to ColumnInfo.
I wonder if there is a way to get Item from observableArray by index. Now that foreach can read and change the observableArray, why not index?
The text was updated successfully, but these errors were encountered:
@JSAL- are you asking about a specific index bound in the HTML, such as data-bind="with: ColumnInfo()[3]", and concerned that if index 3 is dropped and re-added into the array, the data-bind wouldn't update, since it was bound to a specific object?
I suspect that the with would catch the observable array access and update when the array changes - nor am I sure I would build my front end with specific index references into an observable array.
That said, (assuming something like with: ColumnInfo()[3]) you could easily implement that as a pureCompued. In your view model, self.nameColumn = ko.pureComputed(function() { return self.ColumnInfo()[3]; }); - however, I'm fairly confident that's essentially exactly what knockout does internally.
I am sorry I can't find any issue about this problem. If there was, please tell me. Thanks very much : ).
My problem is that I want to get the item from an observableArray by index, and when in the html, just like data-bind=“with:ColumnInfo()[Index]”, the array could not update after having modified the value of array item. I think the reason may be that ColumnInfo()[Index] is not longer an item belongs to ColumnInfo.
I wonder if there is a way to get Item from observableArray by index. Now that foreach can read and change the observableArray, why not index?
The text was updated successfully, but these errors were encountered: