jQWidgets Forums

jQuery UI Widgets Forums TreeGrid Tree gris with nested row not working

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 1 month ago.

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

  • Arturop
    Participant

    Hi, i am trying to use treegrid with a json dara format that i can not modify, but i think its structure works with data grid, i actually am working with datatype “json” with a localhost file but in this case i uploaded it to a webserver and used “jsonp”, when i dont use json p i get a json parse error, if i dont try to nest the “checklist” array it also works.

    Please help

    <!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.10.2.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/jqxdatatable.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxtreegrid.js"></script>
        <script type="text/javascript" src="scripts/demos.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var source =
                {
                    datatype: "jsonp",
                    datafields: [
                        { name: "id", map: "id" },
                        { name: "locations_results", type: "array" }
                    ],
                    root: "locations_results>checklists",
                    url: 'http://yuusay.com/baf.json',
                    hierarchy: {root: "locations_results>checklists"},
                    id: "id"
                };
    
                var dataAdapter = new $.jqx.dataAdapter(source);
    
                $("#treeGrid").jqxTreeGrid({
                    width: 400,
                    altRows: true,
                    source: dataAdapter,
                    columns: [
                        { text: "ID", datafield: "id", width: 100 },
                    ]
                });
            });
        </script>
    </head>
    <body class='default'>
        <div id="treeGrid">
        </div>
    </body>
    </html>

    Peter Stoev
    Keymaster

    Hi Arturop,

    I would suggest you to look at the TreeGrid’s Data binding demos and also its help topics to learn how to data bind the widget.

    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.