jQWidgets Forums
jQuery UI Widgets › Forums › Layouts › Docking › mode 'docked' not working ?
Tagged: docking
This topic contains 4 replies, has 3 voices, and was last updated by Peter Stoev 12 years ago.
-
Author
-
Hi,
I have created a simple fiddle where I create one docking panel with 2 windows. By setting the ‘mode’ to ‘docking’ I want to prevent that windows can be dropped outside of the docking container. This however does not seemt o work, as you can still drag and drop the windows outside the dock container:
What am I doing wrong ?
Regards,
StephanHi,
To disable the dragging of a window, use the “pinWindow” method.
$('#docking').jqxDocking('pinWindow', 'window1');
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
The problem I’m having is that the mode ‘docking’ does not appear to work correctly. I want to drag windows, but only between the docking points. I thought that’s what ‘docking ‘ is meant to do. Maybe I misunderstood the meaning of the “docking” mode? My fiddle above demonstrates that you can drag a window to any position, even outside the docking points, when mode “Docking” is set.
Regards,
Stephani got the same problem,
i set the docking mode to “docked”, but see no difference with the default modei can still drag windows anywhere outside the docking, and they become floating.
isn’t “docked” mode preventing any window to become floating ?anyway, i wrote a few lines of codes to get the docked behaviour (might be slower, but it works fine for me)
the key is to use the dragEnd event, check the layout and put back any floating window into the docking again.$('#docking').on('dragEnd', function() { var layout = JSON.parse($('#docking').jqxDocking('exportLayout')); $.each(layout.floating, function(k) { //items is a global array containing all the id of the windows in the docking //using it's length allows us to put the floating window back in last position $('docking').jqxDocking('move', k, 0, items.length); });});
I have to go through the exportLayout as there is no way to get information about the window except it’s id from the event.
I hope this help
regards
KhaldryckHi,
“mode” docked works as expected in the current version – jQWidgets 2.9.1. If you use an earlier version, please consider upgrading to the latest one.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.