knockout.js - dynatree knockout binding issue -


i'm using dynatree knockout. view model contains 'ismanager' boolean property want have displayed using checkbox.

the problem after dynatree binding applied appear have lost binding ismanager property.

here's fiddle: http://jsfiddle.net/markachten/uha3m/

now i'm not sure if knockout issue or dynatree issue. in definition of binding handler? have put in code here when referencing jsfiddle , i'm not sure if pasting entire code handy... anyway, in definition of binding?

ko.bindinghandlers.dynatree = {     ...         }; 

or need pass in binding options?

{     nolink: true,     minexpandlevel: 2     // should go here? } 

some additional comments regarding code: forced set 'nolink' property true in dynatree. if set false, can not check checkboxes. , i'm using span within span display both name , input element.

thanks!

i think dynatree issue(i have same jstree).

the problem here dynatree plugin able draw tree need add new elements html. in other words restructure html again.

you can check checking result html in inspector. 'll find data-bind no longer exist !!!.

so solve issue need put custom binding dynatree on <ul>

<div id="dynatree" data-bind="">     <ul data-bind="template: { name: 'itemtmpl', foreach: persons },dynatree: {}"></ul> </div> 

working demo


Comments