Skip to content
Related Articles

Related Articles

jQWidgets jqxPivotGrid scrollBarsEnabled Property

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 28 Dec, 2021

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 jqxPivotGrid is a powerful and lightweight data visualization widget that is entirely written in JavaScript language. This widget is offering many advanced features and is highly customizable for different needs.

The scrollBarsEnabled property is used for setting or getting whether the scrollbars of the specified jqxPivotGrid widget are enabled or not.

Syntax:

For setting the scrollBarsEnabled property.

$('#jqx_Pivot_Grid').jqxPivotGrid({scrollBarsEnabled: true});

For getting the scrollBarsEnabled property.

$('#jqx_Pivot_Grid').jqxPivotGrid('scrollBarsEnabled');

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-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxsortable.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxmenu.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxpivot.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxpivotgrid.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>

Example: The below example illustrates the jQWidgets jqxPivotGrid scrollBarsEnabled property. In the below example, the value for the scrollBarsEnabled property has been set to true.

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-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxdata.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/jqxmenu.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxpivot.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxpivotgrid.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqx-all.js">
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
        <h3>
            jQWidgets jqxPivotGrid scrollBarsEnabled Property
        </h3>
        <div id="jqx_Pivot_Grid" 
             style="height:160px; width:270px;">
        </div>
        <input type="button" style="margin:10px;" 
               id="button_for_scrollBarsEnabled"
               value="Value of the scrollBarsEnabled property"/>
        <div id="log"></div>
        <script type="text/javascript">
            $(document).ready(function () {
                var data = new Array();
                var i = 0;
                while (i <= 2) {
                    var Column = ["Company"];
                    var Domain = ["Progamming", 
                                  "CS subjects", 
                                  "GATE preparation"];
                    var Rank = ["Ranking"];
                    var row = {};
                    row["Domain"] = Domain[i];
                    row["Column"] = "Company";
                    row["Rank"] = "Domain";
                    data.push(row);
                    i++;
                }
                var dataAdapter = new $.jqx.dataAdapter({
                    localdata: data,
                    datafields:
                        [
                            { name: 'Rank', type: 'string' },
                            { name: 'Domain', type: 'string' },
                            { name: 'Column', type: 'string' },
                        ]
                });
                var pivotDataSource = new $.jqx.pivot(
                    dataAdapter,
                    {
                        values: [
                            { text: 'GeeksforGeeks' }
                        ],
                        columns: [{ dataField: 'Column' }],
                        rows: [{ dataField: 'Rank' }, 
                               { dataField: 'Domain' }],
                    }
                );
  
                $('#jqx_Pivot_Grid').jqxPivotGrid({
                    source: pivotDataSource,
                    scrollBarsEnabled: true
                });
                $("#button_for_scrollBarsEnabled").jqxButton({
                    width: 300
                });
                $('#button_for_scrollBarsEnabled')
                .jqxButton().click(function () {
                    var a = $('#jqx_Pivot_Grid')
                        .jqxPivotGrid('scrollBarsEnabled');
                    $('#log').html(a);
                })
            });
        </script>
    </center>
</body>
  
</html>


Output:

jqxPivotGrid scrollBarsEnabled

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!