Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

ko.observablearray

Replacing item in observableArray

September 20, 2023 by Tarik

The replace function accepts two parameters, the item you want to replace and the new item you want to replace it with. You are passing in the index in place of the item to replace so it doesn’t work. The replace call should be: self.locations.replace(oldLocation, new location(value)); On a side note, you shouldn’t need the … Read more

Categories javascript Tags javascript, knockout.js, ko.observablearray Leave a comment

How to create a computed observable array in Knockout

June 8, 2023 by Tarik

This will combine the two arrays and return the combined list. However, it is not a computed observable array (don’t know if that is even possible), but a regular computed observable. self.masterList = ko.computed(function() { return this.listA().concat(this.listB()); }, this);

Categories knockout.js Tags computed-observable, knockout.js, ko.observablearray Leave a comment

Replace all elements in Knockout.js observableArray

June 3, 2023 by Tarik

The technique that you are using is the recommended approach for completely replacing the data in an observableArray. An observableArray is actually just a normal observable with extra functions added for useful array operations that act on the underlying array and trigger notifications.

Categories javascript Tags javascript, knockout-2.0, knockout.js, ko.observablearray Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa