Questions tagged [knockout-subscribe]
12 questions
10
votes
1 answer
How do I force a Knockout subscribe to fire when the value doesn't change?
I have a set of cascading dropdown lists which are used to select a house address. We break apart the address in this order:
Street Name (e.g. 10th, 11th, Main)
Street Suffix (e.g. St, Ave)
Street Direction
Street Number (house number)
I am using…

Mike Wills
- 20,959
- 28
- 93
- 149
2
votes
1 answer
Knockout subscribe to trigger after dom updates
How can I handle a subscribe that would trigger after the dom is updated? I am trying to run some jQuery that updates the even visible rows on a table by giving them a css class of "even". The subscribe function is listening for a change in a…

Ian Davis
- 19,091
- 30
- 85
- 133
2
votes
1 answer
identifying the target of this keyword in knockout subscribe function
I am just now taking my first read of the knockout library website's Getting Started documentation, and have a question about how to specify the target of the this keyword in the callback function sent to the knockout subscribe function, in the…

Tim
- 8,669
- 31
- 105
- 183
2
votes
2 answers
Knockout subscribe is evaluating unexpectedly
I need a timestamp for when a value is updated. For reasons I won't go into here, the value is a writable computed that points to a valueInstance observable, so they basically show the same data.
If I subscribe to the observable it works as…

Homer
- 7,594
- 14
- 69
- 109
1
vote
2 answers
Cyclic dependency using Knockout subscribe
Is there any possible fix to the below code where I face cyclic dependency using Knockout.js…

Venkat
- 273
- 2
- 3
- 13
0
votes
1 answer
Subscribe Firing Twice on Option with Same Value
I have an array that looks like this
[Name: toyota, Model: camry], [Name: toyota, Model: corolla]
the options the name, if I chose one toyota the subscribe function is firing twice. Anyone encounter this?

J.Sibs
- 1
- 1
0
votes
1 answer
Subscription to knockout Observable not working properly
I am using knockout observables in my code.
My code looks like this
self.allAggs = ko.observableArray();
self.aggregatedDataSource = ko.observable( new oj.ArrayTableDataSource(self.allAggs, {idAttribute: 'itemName'})…

schaturv
- 122
- 8
0
votes
0 answers
ko.mapping.fromJS adds extra subscriptions
I'm using KO to bind data in Kendo Window. This is a sample how my html looks like
formId is binded with viewModel. And when document is ready…

cin
- 31
- 5
0
votes
1 answer
How do I determine which DOM element corresponds with a Knockout observable array element?
Within my model I have an object array with observable elements. I have a subscribe on one of these elements (a dropdown list) in order to fill in the next dropdown (cascading dropdowns). I now need to get the description of the selected value in…

Mike Wills
- 20,959
- 28
- 93
- 149
0
votes
1 answer
registerEventHandler not triggered before subscription
In my code I first use registerEventHandler to use the jquery currency plugin so it maps "€ 123,00" to 123,00.
ko.bindingHandlers.currency = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
…

Boris Callens
- 90,659
- 85
- 207
- 305
0
votes
1 answer
Enforce Knockout computed observableArray to have length of 1 (one)
I have a computed observableArray called selectedToppings which returns filtered data from another observableArray called toppings. selectedToppings should return all toppings that have their observable property of selected set to true. In some…

kzh
- 19,810
- 13
- 73
- 97
-1
votes
1 answer
What is the term prototype and subscribe in knockout?
I am going over someone else's code and trying to understand what they have done.
There are terms in there that I have no idea what they are.. Prototype, subscribe?? Can someone help me in understanding what this function is…

Sarah
- 1,199
- 2
- 21
- 42