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

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

Android soft keyboard reverts to default keyboard on orientation change -

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