1
votes

I wanted to use jQWidgets number input together with Knockout, but I can't get it to work. I can't even get it to work on their demo page.

No matter how much I change the value, clicking "Get value" only gets the original value. Also, changing the value and then checking and unchecking the disabled checkbox resets the input to the orignal value.

Clicking the "Set value" button only runs a predefined function that sets its value. I'm just curious as to why the observables value isn't changed when you change the inputs value.

Is the widgets Knockout integration borked, or am I just stupid? I've tried the above linked page in Chrome, Firefox and IE11, all with the same result.

If this widget is indeed broken, suggestions to similar "plugins" (masked numerical input) that works with Knockout will be greatly appreciated.

1
Only the example page is broken. The examples are using the old knockout bindings are using the old event name: valueChanged while the new event name is valuechanged. If you download the plugin the package will contain the new/fixed knockout bindings. - nemesv
Actually, I did download the entire package before writing this question. The result was exactly the same as described in the question. I tried both Chrome, Firefox and IE11. Changing the value and clicking the "Get value" button still shows the original value. Checking and unchecking the checkbox still resets the original value. - Ludvig Sjöbeck
nemesv is not right. According to the jQWidgets Release Notes, there is a breaking change in version 3.5 - valuechanged event was renamed to valueChanged. It seems however that there was a problem with that change in the jqxknockout plugin, but it seems to work correctly now. - scripto
So it does. Thanks @scripto for your comment. Do you maybe also, by any chance, have the answer to the following 2 questions? 1. Can you force it to update to the min or max value on blur. 2. Can you hook it up with Knockout validation. I can't make it work. The error style is not applied even tho the field is erroneous. - Ludvig Sjöbeck
@scripto - I forogot about this question. Would you put your comment in an answer and I'll mark it as the answer (since it actually WAS the answer). - Ludvig Sjöbeck

1 Answers

1
votes

According to the jQWidgets Release Notes, there is a breaking change in version 3.5 - valuechanged event was renamed to valueChanged. It seems however that there was a problem with that change in the jqxknockout plugin, but it seems to work correctly now.