jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Initiating button inside window
Tagged: javascript window, jquery window, jqwidgets window, jqxButton, window
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 7 years, 1 month ago.
-
Author
-
I have problem in initiating jqxButton inside jqxWindow:
Expected: when I click Add button, the Confirm button caption will set to “Add”, otherwise when I click Edit button.
Problem: the Confirm button caption is set to proper button at the first time I clicked, but then the caption will not changed.
Note: the problem raised if i set window property autoOpen: false.This problem raised when I use jQWidgets V5.1.0.
When I use jQWidgets v4.3.0, this problem is not happen.
<!DOCTYPE html> <html lang="en"> <head> <meta name="description" content="" /> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtabs.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnAdd').click(function () { $('#window').jqxWindow('open'); $("#confirm").jqxButton({ value: "Add" }); }); $('#btnEdit').click(function () { $('#window').jqxWindow('open'); $("#confirm").jqxButton({ value: "Edit" }); }); var jqxWidget = $('#jqxWidget'); var offset = jqxWidget.offset(); $('#window').jqxWindow({ autoOpen: false, minWidth: 200, height: 300, width: 500, initContent: function () { $("#confirm").jqxButton(); } }); }); </script> </head> <body class='default'> <div id="jqxWidget"> <div style="float: left;"> <div> <input type="button" value="Add" id="btnAdd" /> <input type="button" value="Edit" id="btnEdit" /> </div> </div> <div id="mainDemoContainer"> <div id="window"> <div id="windowContent"> <input type="button" id="confirm" /> </div> </div> </div> </div> </body> </html>
Hello emoticon,
I would suggest you try with this approach:
$('#btnAdd').click(function () { $('#window').jqxWindow('open'); $("#confirm").val('Add'); }); $('#btnEdit').click(function () { $('#window').jqxWindow('open'); $("#confirm").val('Edit'); });
Also, I notice that there is missing a <div/> container for the window’s header.
Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comThank you for your reply!
I can solve this with your approach, but I wonder why it didn’t work with standard JQWidget syntax that it works with the old version?
Hello emoticon,
Thank you for the interest.
We will investigate this.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.