jquery - Using custom knockoutjs select binding with standard select bindings as well -


i trying combine custom knockoutjs binding standard binding. although have been able find related solution

ko.bindinghandlers.parentareacombobox = {  initialised: false, init: function (element, valueaccessor, allbindingsaccessor, viewmodel, context) {      viewmodel.parentareas.subscribe(function (newparentareas) {          if (newparentareas && newparentareas.length > 0) {              if (ko.bindinghandlers.parentareacombobox.initialised) {                 return;             }             ko.applybindingstonode(element, {                 options: viewmodel.parentareas,                 optionscaption: 'choose...',                 optionstext: 'label',                 value: viewmodel.selectedparentarea             });             $(element).chosen({});             ko.bindinghandlers.parentareacombobox.initialised = true;         }     });   } }; 

but not able make work on mine. doing wrong here?

use debugging console in browser (press f12) , jshint button in jsfiddle. vm constructor function invalid. once fix that, you'll notice you're trying use subscribe on not observable.


Comments

Popular posts from this blog

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -

javascript - Using jquery append to add option values into a select element not working -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -