jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Input value in window not change with knockout
Tagged: window knockout not update
This topic contains 2 replies, has 2 voices, and was last updated by Makla 12 years, 2 months ago.
-
Author
-
I discover a funny bug. If is a bug.
I have a jqxInput and a jqxButton inside jqxWindow. On button click I send value from input to server via ajax. Everything ok and works. The Model is updated…
But if I resize the window to the point that vertical scroll is showned, but button still visible, the model is not changed. If I move mouse over scrolls and then click button the model is updated.I need my model to be updated in every case.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Demo</title> <script src="Framework/Scripts/jquery-1.9.1.min.js"></script> <script src="Framework/Scripts/knockout-2.2.1.js"></script> <script src="Framework/Scripts/jqwidgets/jqx-all.js"></script> <link rel="stylesheet" href="Framework/Styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="Framework/Styles/jqx.ui-sunny.css" type="text/css" /> <script type="text/javascript"> $(document).ready(function () { // View Model var listModel = function () { this.text = ko.observable(""); this.ButtonClick = function() { alert(this.text()); } }; var model = new listModel(); ko.applyBindings(model); $('#window').jqxWindow({height: 80, width: 250}); $('#TableName').jqxInput({ placeHolder: "enter something", height: 25, width: 200 }); });</script></head><body><div id="window"> <div>title</div> <div> <form id="form"> <input type="text" id="TableName" data-bind='value: text'> <br /> <input data-bind="value: 'click', click: ButtonClick, jqxButton: {width: '120px'}" type="button" /> </form> </div></div> </body></html>
Hi Makla,
One very important thing that is missing in your code is:
<!DOCTYPE html>
. I will test your code and will try to reproduce the reported behavior.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI almost think that this solved my problem. But it didn’t. Anyway, thanks for that.
Just copy the code and try entering something inside textbox and then click button. If everything is OK, remove text from textbox and click the button again. Repeat the steps. Eventually the input text will not matched the allerted text.
-
AuthorPosts
You must be logged in to reply to this topic.