Questions tagged [knockout-postbox]

knockout-postbox is a Knockout.js plugin designed to use Knockout's basic pub/sub capabilities to facilitate decoupled communication between separate view models / components.

knockout-postbox is a Knockout.js plugin designed to use Knockout's basic pub/sub capabilities to facilitate decoupled communication between separate view models / components.

Further details can be found here: http://www.knockmeout.net/2012/05/using-ko-native-pubsub.html

13 questions
14
votes
4 answers

Whats the best way of linking/synchronising view models in Knockout?

If you have several view models on one page, how do you ensure that you can keep them synced? For example, if one item is added or a button clicked on one view model and you want the other view model to be sensitive to that change, can Knockout…
jaffa
  • 26,770
  • 50
  • 178
  • 289
1
vote
2 answers

Automatic disposal of ko postbox subscriptons

I have a single page app that consists of 2 main pieces: 1.-A top bar that has dynamic content(there is a shopping cart) 2.-A dynamic component that gets loaded based on the url. A few times the components use postbox in order to communicate, the…
Daniel 1.618
  • 107
  • 1
  • 8
1
vote
2 answers

Inter-component communication with KnockoutJS

Say you have a product overview page with the following view models: ProductIndexViewModel; the root view model that is bound to the entire page ProductListViewModel; a widget for displaying all products ProductRegistrationViewModel; a widget for…
Martin Devillers
  • 17,293
  • 5
  • 46
  • 88
1
vote
2 answers

How to exchange value between two viewmodels in knockout js

Hi i have two view models and i want to transfer a value between them. here is js fiddle `http://jsfiddle.net/sohimohit/e84u8L85/` i want when a user click on show another div button then corresponding item name should be display on another div .…
user2142786
  • 1,484
  • 9
  • 41
  • 74
1
vote
1 answer

Knockout array being displayed as a function, not the contents

I have the following: this.testArray = ko.observableArray(["a", "b"]); this.publishedSelectedSets = ko.observableArray().subscribeTo("SELECTED_SETS"); Then in my view I have:
RobVious
  • 12,685
  • 25
  • 99
  • 181
0
votes
1 answer

Transform method not working in knockout js postbox

I am using the knockout postbox plugin to follow the pub sub pattern in knockout. I am able to receive and send data between components but the issue is that I am not able to use the transform functionality. Below is the code and the fiddle…
SP1
  • 1,182
  • 3
  • 22
  • 47
0
votes
1 answer

Knockout Postbox communicating between components - how to ensure subscriber is active

I have an issue where I am publishing on a knockout observable within a component, and have another component with a view model that subscribes to this postbox event. The publish event is within my 'data-table' components view model and is as…
Jamie Mclaughlan
  • 845
  • 2
  • 10
  • 29
0
votes
1 answer

WebSocket Message Callback and Knockout JS View Model Communication

I need to make data which is available in the "onmessage" Callback function of WebSocket connection to a Component View Model of KnockoutJS. sockjs.onmessage = function (e) { //console.log('[.] message', e.data); if(e.data &&…
Amit Dube
  • 947
  • 4
  • 10
  • 23
0
votes
2 answers

Intermodular communication in Oracle JET

I have created a Sample application in Oracle JET using Oracle JET QuickStart Basic template. I want the application to have communication between two mudules. I have tried using the steps mentioned in Geertjan's blog Intermodular communication in…
Arun
  • 15
  • 1
  • 7
0
votes
0 answers

knockout-postbox syncwith not working with observable arrays

I have the below view models. in view model one I also have some code that adds records to accountList. when I then try to use accountList in viewmodel two, it's always empty. shouldn't the syncWith keep those two observableArrays in…
user1813251
  • 329
  • 3
  • 18
0
votes
1 answer

PublishOn not firing when I delete input content

I am using knockout-postbox to mark dirty flag. The code looks like this: var ProfileModel = function() { this.nickName = ko.observable("name1").publishOn("dirty", true); this.emailAddress = ko.observable("email1").publishOn("dirty",…
kennethc
  • 814
  • 1
  • 10
  • 26
0
votes
0 answers

passing object to other viewmodel using pubsub?

I've created 2 knockout components using the new knockout version 3.2 (and requirejs). the first component contains a html template for showing a table of objects which are contained in an observable array in my viewmodel if the component. …
Luuk Krijnen
  • 1,180
  • 3
  • 14
  • 37
0
votes
1 answer

Perform lookup when ko postbox value published

I started writing out this question wanting to know how to fire off a lookup function when an observable property gets changed by another viewmodel, and am now questioning how I am approaching this problem. In any case, here is my scenario: I have…