Questions tagged [computed-observable]

A computed observable is a synchronously updated value based on other observables; if they change so does the computer observable, immediately. A term frequently used with Knockout.js.

A familiar computed observable would be a cell in a spreadsheet that contains the sum of a column. If any of the cells in the column change, the sum is immediately updated.

Reference: http://knockoutjs.com/documentation/computedObservables.html

132 questions
0
votes
1 answer

KnockoutJS computed does not compute (or update)

Under certain circumstances a ko.computed will not update even though the ko.observable that it is bound to changes. I would like to know why, what I am doing wrong and what I should be doing instead. Example Consider this simple…
Tomas Eklund
  • 573
  • 1
  • 4
  • 16
0
votes
1 answer

Knockout.js Computed not Displayed Upon User Selection

I have a table, where each row is bound to a Knockout.js model: foreach: treatmentsOptions I would like for the user to be able to click on an "Add" button in each table row, and for that to be colored differently, and there can be multiple added…
0
votes
1 answer

KO: Computed observable of variabble which is not used in function

I have three observable objects as stated below: self.firstName = ko.observable(); self.lastName = ko.observable(); self.middleName = ko.observable(); And than I have computed observable as shown below: ko.computed(function() { var…
ConfusedDeveloper
  • 6,389
  • 4
  • 21
  • 36
0
votes
1 answer

How to set focus of input after computed has been updated

I have table/grid that shows devices based on their type. Whenever the dropdown changes, the table should update to show the correct devices. To do this i have a computed that filters the devices by type and adds a new blank row to the…
homes
  • 265
  • 1
  • 3
  • 12
0
votes
1 answer

Does a writable computed observable really need an extra internal observable?

I am trying to use a writable computed observable, but do not really get it why I cannot get some data in the observable by just typing in it. I found that I need an extra observable to copy content from the write: to the read:, which seems weird. …
Roland
  • 4,619
  • 7
  • 49
  • 81
0
votes
1 answer

Knockout computed vs custom binding calculation order

I defined a custom binding that alters some way an observable's property, let's say customProperty. (for example): ko.bindingHandlers.customBinding = { update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { …
Nillus
  • 1,131
  • 1
  • 14
  • 32
0
votes
1 answer

Checkbox not updating value knockout js

I'm new at knockout js and feel I may not be understanding something here. I basically have a MVC checkbox, that when checked will update another field which is dependent on other field calculations. I can get the total amount field to update with…
Jand
  • 406
  • 2
  • 7
  • 22
0
votes
2 answers

how to compute 2 list based on a list's item's property in knockout?

As a learning exercise, I have a todo list with to do items. In my view, I would like to display the items grouped by completion. Below is my viewmodel. How would I go about doing what I want to achieve, how do I setup the computed observables? …
lee23
  • 409
  • 1
  • 3
  • 10
0
votes
1 answer

Computed observable not updating UI

I have a problem with a computed variable in my knockout web. Here's my code: function ViewModel() { var self = this; self.seatsRaw = ko.observableArray([]); self.selectedSeatId = ko.observable(); self.session = ko.observable(); …
Jon Zangitu
  • 957
  • 1
  • 15
  • 30
0
votes
3 answers

How assign undefined value in a knockout JS variable?

I have 2 dropdownlists and one list of result with a binding using computed observable function something like this: self.Records = ko.computed(function() { if (self.dropdown1 !== undefined) { ... …
UserEsp
  • 415
  • 1
  • 7
  • 29
0
votes
1 answer

How to set Conditional Select Menu on Load - KnockoutJS

I've been working on a two-level, conditional select menu that will change the second level options based on the first level selection. The conditional portion is working fine, but I'm realizing I'll need to support an option on load so both select…
0
votes
0 answers

Breeze: server computed properties to breeze computed observable

I am able to have breeze capture server computed properties using this code, gotten from HERE. var yourTypeCtor = function () { this.calculatedProperty = ""; }; store.registerEntityTypeCtor("YourType", yourTypeCtor); I have a computed…
jpo
  • 3,959
  • 20
  • 59
  • 102
0
votes
1 answer

Computed observable does not update

I have a computed observable that looks like this: this.isActive = ko.computed(function () { this.structure().valueSets(); return this.structure().containsValueSet(this.valueSet()); }, this); this.structure() is an instance of a…
DenEwout
  • 885
  • 2
  • 10
  • 17
0
votes
1 answer

Knockout add item to each of the observable array

I have a function and this is the code: this.federalPriceComputed = ko.pureComputed( function() { return ko.utils.arrayMap(this.lineItems(), function(item) { var total = item.price() * item.federalTax() …
Chun ping Wang
  • 3,879
  • 12
  • 42
  • 53
1 2 3
8 9