jQWidgets Forums

jQuery UI Widgets Forums Grid Nested grid with array

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Nested grid with array #6967

    rkmoray
    Member

    It appears I need localstorage fulfill my offline needs, so I need to use arrays for everything, than convert the array data to localstorage (ok…I got it).

    I have a master array, but how do I combine that to get the nested grid example in your demos.

    Here is the code that I have to create the master part of the grid

    <script type="text/javascript">
    
            $(document).ready(function () {
                var theme = getTheme();
                // prepare the data
                var data = new Array();
                var titles =
                [
                    "title1", "title2", "title3", "title4",
                
                ];
                
                for (var i = 0; i < 40; i++) {
                    var row = {};
                    row["title"] = titles[i];
                   data[i] = row;
                }
                var source =
                {
                    localdata: data,
                    datatype: "array"
                };
                var dataAdapter = new $.jqx.dataAdapter(source);
                $("#jqxgrid").jqxGrid(
                {
                    width: 670,
                    source: dataAdapter,
                    theme: theme,
                    columnsresize: true,
                    columns: [
                      { text: 'Summary Titles', dataField: 'title', width: 300 }
    
                    ]
                });
            });
        </script>
    Nested grid with array #6978

    Peter Stoev
    Keymaster

    The following post demonstrates how to create Nested Grids from Array: assembling-n-nested-jquery-grid.

    Hope this helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.