ui.igHierarchicalGrid

ui.igHierarchicalGrid_image

The igHierarchicalGrid control is a hierarchical jQuery Grid control that features filtering, group by, column hiding, paging, column resizing, row selectors, cell selection, sorting, column summaries, tooltips, and updating functionality. For more information on each of these features, see their corresponding API document: igGridFiltering, igGridGroupBy, igGridHiding, igGridResizing, igGridPaging, igGridRowSelectors, igGridSelection, igGridSorting, igGridSummaries, igGridTooltips, igGridUpating. The igHierarchicalGrid control is built on top of the stand-alone flat-data igGrid control. The API for the igGrid control serves as the base for configuring the igHierarchicalGrid control and its columnLayouts settings. See the igGrid control API document for more details.

The following code snippet demonstrates how to initialize the igHierarchicalGrid control.

Click here for more information on how to get started using this API. For details on how to reference the required scripts and themes for the igHierarchicalGrid control read, Using JavaScript Resources in Ignite UI and Styling and Theming Ignite UI.

Code Sample

         
<!doctype html>
<html>
<head>
    <!-- Infragistics Combined CSS -->
    <link href="css/themes/infragistics/infragistics.theme.css" rel="stylesheet" type="text/css" />
    <link href="css/structure/infragistics.css" rel="stylesheet" type="text/css" />
    <!-- jQuery Core -->
    <script src="js/jquery.js" type="text/javascript"></script>
    <!-- jQuery UI -->
    <script src="js/jquery-ui.js" type="text/javascript"></script>
    <!-- Infragistics Combined Scripts -->
    <script src="js/infragistics.core.js" type="text/javascript"></script>
      <script src="js/infragistics.lob.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
        var jsonData = { "d": [
            {
                "ID": 0,
                "Name": "Food",
                "Category": { "ID": 0, "Name": "Food", "Active": true, "Date": "\/Date(1059660800000)\/" },
                "Products": [
                    { "ID": 0, "Name": "Bread", "Price": "2.5" }
                ]
            },
            {
                "ID": 1,
                "Name": "Beverages",
                "Category": { "ID": 2, "Name": "Beverages", "Active": true, "Date": "\/Date(1159660800000)\/" },
                "Products": [
                    { "ID": 1, "Name": "Milk", "Price": "3.5" },
                    { "ID": 2, "Name": "Vint soda", "Price": "20.9" }
                ]
            },
            {
                "ID": 2,
                "Name": "Electronics",
                "Category": { "ID": 5, "Name": "Electronics", "Active": false, "Date": "\/Date(1859660800000)\/" },
                "Products": [
                    { "ID": 7, "Name": "DVD Player", "Price": "35.88" },
                    { "ID": 8, "Name": "LCD HDTV", "Price": "1088.8" }
                ]
            }
        ]}
 
        $("#hierarchicalGrid").igHierarchicalGrid({
            initialDataBindDepth: 1,
            dataSource: jsonData,
            dataSourceType: "json",
            responseDataKey: "d",
 
            autoGenerateColumns: false,
            primaryKey: "ID",
            columns: [
                { headerText: "ID", key: "ID", width: "50px", dataType: "number" },
                { headerText: "Name", key: "Name", width: "130px", dataType: "string" }
            ],
            autoGenerateLayouts: false,
            columnLayouts: [
            {
                key: "Products",
                responseDataKey: "",
                childrenDataProperty: "Products",
                autoGenerateColumns: false,
                primaryKey: "ID",
                columns: [
                    { key: "ID", headerText: "ID", width: "25px" },
                    { key: "Name", headerText: "Product Name", width: "90px" },
                    { key: "Price", headerText: "Price", dataType: "number", width: "55px" }
                ]
            }
        ]
        });
    });
    </script>
</head>
<body>
<table id="hierarchicalGrid"></table>
</body>

Related Samples

Related Topics

Dependencies

jquery-1.9.1.js
jquery.ui.core.js
jquery.ui.widget.js
infragistics.ui.widget.js
infragistics.datasource.js
infragistics.ui.shared.js
infragistics.util.js
infragistics.ui.grid.framework.js

Inherits

Copyright © 1996 - 2025 Infragistics, Inc. All rights reserved.