Questions tagged [ko-custom-binding]

Use this tag for question regarding the creation or use of Knockout js custom bindings

Knockout custom bindings allow to encapsulate behaviors that control the interaction between DOM elements, and bound observables.

This gives a lot of flexibility to encapsulate sophisticated behaviors in an easy-to-reuse way, for example grids.

Custom bindings can also be used to allow to bind components and behaviours existing in other libraries like jQuery, jQuery plugins, or jQuery UI.

This is the official documentation on Creating custom bindings.

39 questions
0
votes
1 answer

Knockout custom binding firing multiple times

I have that a custom binding that fires for each element on the page that uses the same binding ie. this code will fire the binding 3 times when I enter text in the first field.
dex
  • 275
  • 1
  • 4
  • 10
0
votes
0 answers

Modify and Call Custom Binding In Knockout.js Explicitly

Can I call the custom binding called form from another custom binding called addAnother explicitly? Also can I modify the parameters going into the parent custom binding? ko.bindingHandlers.addAnother = { init: function (element,…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
1 answer

knockout.js custom binding foreach - using ID

I want to create one list which is filtered by Soid Bascially i have 2 kind of list : 1 Employees, 2 Transactions Employees got EmpID and Name Transactions got `ID` , EmpID , and TransDate I want filter something like this : data-bind="foreach:…
vir
  • 55
  • 1
  • 6
0
votes
1 answer

knockout.js calling custom binding function

I've found an unusual code, but I don't understand how to call this custom binding function and how is that supposed to work. So here is my code: ViewModel: ko.bindingHandlers.test = function ($) { return { init: function (el,…
desperate man
  • 905
  • 1
  • 17
  • 39
0
votes
1 answer

unable to detect events in custom binding

Trying to create a custom binding, which will detect when values change in one of two input boxes, when they change I want to enable the 'Save' button. Initially the 'Save' button is disabled. I can't seem to get it to detect the events, I'm…
LRP
  • 283
  • 1
  • 3
  • 5
0
votes
1 answer

Knockout custom binding on button

I have some issues creating a custom binding. From what i understand the update callback of the binding should fire every time the view model changes. I have created a small example. http://jsfiddle.net/alexmaie/pbEmS/ …
Alex Maie
  • 269
  • 3
  • 13
0
votes
2 answers

Knockoutjs Custom Binding style child

I have a custom binding.
in my init function I do this. I add a inputbox that I need to be styled. $element.append("
user1199595
  • 406
  • 2
  • 7
  • 16
0
votes
2 answers

Editable string knockoutJS custom binding

I often display text data on the web page that I need to change. Currently, I write a custom mouseEvent handlers to show an "edit" button pop over a div with an observable-bound span is moused over. If a user clicks it, I hide a span via visible…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
0
votes
1 answer

knockout.js and disable custom binding

I would like to bind disabled and css within a custom binding instead of using JQuery to assign a class and disabled it. Can you do this within a custom binding without doing $(element).attr('disabled',…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
1 2
3