jQWidgets Forums
jQuery UI Widgets › Forums › Layouts › Docking › Error in jxDocking after upgrading to 2.9
Tagged: docking windows
This topic contains 4 replies, has 2 voices, and was last updated by dpdragnev 11 years, 8 months ago.
-
Author
-
Hi,
I upgraded to v.2.9 this morning and now when I load a page with jqDocking on it I get the following error:
Error: Invalid jquery selector – window5! Please, check whether the used ID or CSS Class name is correct.
window5 is the id of one of the windows in the docking element. I checked the spelling and everything is in order. Nothing else have changed except the upgrade to 2.9.
On the page I have the jqDocking element which has 5 windows: window1 to window5. I moved window5 before window4 and now I am getting the same error but for window4. It looks like the code has a problem with the last window.
Here is how I initialize the jqDocking:
$(‘#docking’).jqxDocking({ theme: theme, orientation: ‘horizontal’, width: 294, mode: ‘docked’ });
$(‘#docking’).jqxDocking(‘showAllCollapseButtons’);
$(‘#docking’).jqxDocking(‘hideAllCloseButtons’);
$(‘#docking’).on(‘dragEnd’, function (event) {
//save the layout
var layout = $(‘#docking’).jqxDocking(‘exportLayout’);$.ajax({
type: “POST”,
url: “/Profile/SaveLayout”,
data: {
layout: layout
}
}).done(function (result) {});
});Here is my HTML code:
<div id=”docking”>
<div>
<div id=”window3″ style=”height: 120px;”>
</div>
<div id=”window1″ style=”height: 300px;”>
</div>
<div id=”window2″ style=”height: 220px;”>
</div>
<div id=”window5″ style=”height: 255px;”>
</div>
<div id=”window4″ style=”height: 120px;”>
</div>
</div>
</div>I am using jquery 1.10.1.min.
Thank you for your help.
Hi,
jQWidgets 2.9 adds validation for invalid HTML structures and calling methods/properties of invalid jQuery selection.
The HTML Structure of the jqxWindows in the provided code is not the expected one.
I corrected it and here’s the modified version below:
<!DOCTYPE html><html lang="en"><head> <title id='Description'>In this demo, the jqxDocking layout is exported to JSON string by using the exportLayout method.</title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.web.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.8.3.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/jqxdocking.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#docking').jqxDocking({ theme: 'classic', mode: 'docked', orientation: 'horizontal', width: 300}); $('#docking').jqxDocking('showAllCollapseButtons'); $('#docking').jqxDocking('hideAllCloseButtons'); $('#exportButton').click(function () { $('#exportOutput').val($('#docking').jqxDocking('exportLayout')); }); }); </script></head><body class='default'> <div id="docking"> <div> <div id="window3" style="height: 120px;"> <div>Title</div> <div>Content</div> </div> <div id="window1" style="height: 300px;"> <div>Title</div> <div>Content</div> </div> <div id="window2" style="height: 220px;"> <div>Title</div> <div>Content</div> </div> <div id="window5" style="height: 255px;"> <div>Title</div> <div>Content</div> </div> <div id="window4" style="height: 120px;"> <div>Title</div> <div>Content</div> </div> </div> </div> <div> <br /><br /> <input type="button" value="Export layout" id="exportButton" /><br /> <textarea id="exportOutput" rows="20" cols="40"></textarea> </div></body></html>
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Sorry the code did not display:
Hi,
I am not sure whether the issue that we resolved is related to the one you experience, but we resolved a small problem in jqxWindow and released a new version this afternoon – jQWidgets 2.9.1. I suggest you to try it out. If you still experience some issue, then please send us a sample to support@jqwidgets.com.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you Peter,
I downloaded 2.9.1 and the error is gone.
Appreciate your help.
-
AuthorPosts
You must be logged in to reply to this topic.