Skip to content
Related Articles

Related Articles

jQWidgets jqxDocking setWindowMode() Method

View Discussion
Improve Article
Save Article
  • Last Updated : 31 Oct, 2021
View Discussion
Improve Article
Save Article

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxDocking is used for representing a widget to manage multiple windows and also the layout of a web page. 

Each window in the specified jqxDocking can do multiple tasks such as it can be dragged around the web page, docked into docking zones, removed from the docking, collapsed into a minimized state for hiding its content, and also can be expanded for displaying its content.

The setWindowMode() method is used for setting mode to a window of the specified jqxDocking.

Syntax:

$('#jqxDocking').jqxDocking('setWindowMode', windowId, mode);

 

Parameters: This method accepts two parameters that are illustrated below.

  • windowId: This is the id of a window for which mode is being set.
  • mode: This is the specified mode. Its possible values are ‘default‘ or ‘float‘.

Return values: This method does not return any values.

Linked Files: Download jQWidgets from the given link. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdocking.js”></script>

Example: The below example illustrates the jQWidgets jqxDocking setWindowMode() method. In the below example, the mode of the window was ‘floating’ then later after invoking setWindowMode() method, the mode of the window has been changed to ‘default’.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" 
          href="jqwidgets/styles/jqx.base.css" 
          type="text/css"/>
    <script type="text/javascript" 
            src="scripts/jquery.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxdocking.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxwindow.js">
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
        <h3>
            jQWidgets jqxDocking setWindowMode() Method
        </h3>
        <div id="jqx_Docking" style="margin:25px;" align="left">
            <div>
                <div id="Window">
                    <div>Window</div>
                    <div>
                        <h8>Content of the window</h8>
                        <ul>
                            <li>GFG</li>
                            <li>CSE</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <input type="button" style="margin:29px;" 
               id="jqxbutton_for_setWindowMode"
               value="Set the mode of above window to default"/>
        
        <script type="text/javascript">
            $(document).ready(function () {
                $("#jqx_Docking").jqxDocking({
                    width: 250,
                    windowsMode: {
                        'Window': 'floating'
                    }
                });
                $("#jqxbutton_for_setWindowMode").
                    jqxButton({
                        width: 300
                    });
                $('#jqxbutton_for_setWindowMode').on(
                    'click', function () {
                        var windowsId = 'Window';
                        var mode = 'default';
                        $('#jqx_Docking').jqxDocking(
                            'setWindowMode', windowsId, mode);
                    });
            });
        </script>
    </center>
</body>
</html>


Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxnavigationbar/jquery-navigationbar-api.htm?search=


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!