Closed techygarg closed 11 years ago
So, how are you adding items to the Parent Model. Are you doing a push
on self.Departments
.
Can you maybe get an example in jsFiddle? Here is something to start with: http://jsfiddle.net/rniemeyer/XzU4t/
Yes, I am using push to add items in parent model.
@rahulgarg1985 - are you still having an issue? Can you recreate it in a fiddle and reopen this issue, if you are still seeing a problem? Thanks!
Hi,
I am using Publisher and Subscriber with my Knockout models. I am facing problem to update run time generated observable array with Publisher and Subscriber.
Code Example :
In Parent Model self.Departments = ko.observableArray([]).publishOn("DepartmentList_" + transportId);
In Child Model
this.DepartmentList = ko.observableArray([]).subscribeTo("DepartmentList_" + transportId);
Parent Model contain one child model initially and pub-sub works fine, but if I add another child at run time,after apply bindings, (transportId is same for both childs), second child's DepartmentList does not update when Parent's Departments changes.
Basically pub-sub not working for items added after applyBindings.
It would be great if any body can put some light on it.