javascript - Knockout input binding not working -


i have input box , binding value value in viewmodel. not binding. have no idea why.

that input box markup:

<input data-bind="value : $root.rootdata.page(), valueupdate:'afterkeydown'" class="form-control" placeholder="jump ..."> 

here sending value entered user function in js:

<button type="button" class="btn btn-default" data-bind="click: $root.selectpage.bind($root, $root.rootdata.page())"> search! </button> // not works  <button type="button" class="btn btn-default" data-bind="click: $root.selectpage.bind($root, parseint(7))"> search! </button>  // works, 7 @ js function. 

in js function, getting old value. if send constant value, such 7, works, , in js function. means input box binding not working. idea why input binding not working?

you don't need unwrap observable in binding, try "value:$root.rootdata.page"


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -