Questions tagged [custom-binding]

KnockoutJS: Extending KnockOut JS's built-in bindings to allow a lot of flexibility to encapsulate sophisticated behaviors in an easy-to-reuse way.

156 questions
0
votes
0 answers

Custom binding handlers making validation message show on Add ? Knockout

I been working on custom binding handlers to bind formatted value to my text-box and i'm pretty successful with that . Here i am adding a validation (required:true,number:true) on the same text-box i'm referencing to . Binding Handler…
super cool
  • 6,003
  • 2
  • 30
  • 63
0
votes
1 answer

How to call a knockout function with bootstrap-switch.js binding?

I'm trying to show my data in a table but instead of checkbox show something fancy like http://www.bootstrap-switch.org/ I've managed to build my table and handle the plugin using this binding ko.bindingHandlers.bootstrapSwitchOn = { init:…
Icepick
  • 159
  • 1
  • 10
0
votes
3 answers

Cannot set the minDate of a dynamically added element

I have a webpage which has a repeating partial view which is being bound to a Knockout template. Within that view, I have a datepicker. That view can be added any number of times on a button click. The selection of a date in section 1, sets the…
0
votes
1 answer

Passing an array as an option to a Knockout custom binding

So I'm sure I'm not the first person who's ever tried to do this, but I can't find any examples that match what I'm trying to do so here I am. I have a Knockout custom binding that is defined as such. ko.bindingHandlers.table = { init: function…
Randy P.
  • 194
  • 1
  • 3
  • 16
0
votes
1 answer

Why is this event being handled twice in knockout?

For some reason the below code makes the links' click event fire twice. I'm relatively new to knockout and I think I might have done my custom binding wrong. Can anyone tell me what I've done wrong? (Btw, the reason I didn't post a fiddle is that I…
LordZardeck
  • 7,953
  • 19
  • 62
  • 119
0
votes
1 answer

How do I trigger custom binding on click event on knockoutjs?

I'm trying to use customBindings but I have no idea how to achieve this. I heard people saying that DOM manipulation shouldn't be mixed in ViewModel so that's why I'm trying to create CustomBindings. Here's Jsfiddle…
toy
  • 11,711
  • 24
  • 93
  • 176
0
votes
1 answer

Possible for Knockoutjs custom binding to detect change of css class in element?

I have KO custom binding on an input element and need it to detect if there's been a change (or addition) of a css class for that element. Is this something I detect using a custom binding, or not?
hotdiggity
  • 329
  • 7
  • 23
0
votes
1 answer

Silverlight Custom Binding from CodeBehind

I have seen lots of examples regarding WShttpbinding and Silverlight. Also, I successfully managed to run the application but I have to create custom binding from code behind. I have tried that out but am getting an Error as below: In Binding…
Chirag
  • 375
  • 4
  • 30
0
votes
1 answer

How do i get element bindings dynamically added?

If i have a custom-binding that aggregates others like the following: ko.bindingHandlers.binding1 = { init: function (element, valueAccessor, allBindingsAccessor, viewModel) { var ctx = ko.utils.unwrapObservable(valueAccessor()); …
0
votes
1 answer

Knockout Binding with Virtual Elements Not Working

I'm working on some custom bindings, and in one I'd like to be able to show a table from some arrays of strings. fiddle I simplified it down to this custom binding: ko.bindingHandlers.table = { init: function tableBinding(element, valueAccessor,…
Brigand
  • 84,529
  • 20
  • 165
  • 173
0
votes
1 answer

How do you expose a function on an object wrapped by a knockout custom binding?

I'm currently using the Bing Maps KO custom binding to make using a Bing Maps control in Durandal nice and easy. So far I've extended the custom binding to allow for an info box and that works fine as I simply have to set the value of an observable…
user310988
0
votes
0 answers

Knockout Custom Binding using templates with nested foreach

I have a problem where I have 4 nested lists each inside it's own knockout model. A form has pages. A page has sections. A section has groups. A group has controls. Each level (page, section, group, control) except groups is sortable within…
jspence
  • 409
  • 4
  • 13
0
votes
1 answer

Update Event on Custom Binding Not Triggered

this is my html : Hi, Guys, I am new bie on knockoutjs world, but i am feeling very interested to use it in my next project because it seems it is a powerfull framework. But i a having some obstacles to understand on how the knockoutjs custom…
John Hadikusumo
  • 1,317
  • 2
  • 11
  • 20
0
votes
1 answer

Custom Binding triggers error with Script Bundle in Production

I have the following KnockoutJS custom binding: ko.bindingHandlers.dtp = { init: function (element, valueAccessor, allBindingsAccessor) { //initialise datetimepicker with some optional options var options =…
daveywc
  • 3,136
  • 7
  • 45
  • 58
0
votes
1 answer

KnockoutJS UI helper bindings

I'm working on some UI automation using KnockoutJS. My question is fairly simple; While using KnockoutJS I would like to create something like:
with a custom binding. The endresult should look…
Mr. Baudin
  • 2,104
  • 2
  • 16
  • 24