Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1905
igTreeGrid LoadOnDemand not working
posted

I am trying to get igTreeGrid working with LoadOnDemand, and it isn't working very good at all.  I use TreeHierarchicalDataSource because I want to use customEncodeUrlFunc to add some attributes, but my customEncodeUrlFunc never gets called.  The ajax call will get made when the grid is initially loaded, but after it loads the top level clicking the + just makes it starts spinning with no ajax call actually made.  I've tried all kinds of things to make it work, but nothing does.  Below is the current state of my code.

HTML:

          <table id="treeItems">table>

BLOCKED SCRIPT

          var dsOptions = {

                primaryKey: "key",

                dataSource: getDataUrl,

                type: "remoteUrl",

                treeDS: {

                    dataSourceUrl: getDataUrl,

                    childDataKey: "items",

                    enableRemoteLoadOnDemand: true,

                    customEncodeUrlFunc: function (data, expand) {

                        return getDataUrl + "?targetDate=" + encodeURIComponent($("#targetDate").val());

                    }

                }

            };

            var ds = new $.ig.TreeHierarchicalDataSource(dsOptions);

            var options = {

                width: "100%",

                //primaryKey: "key",

                childDataKey: "items",

                autoGenerateColumns: false,

                dataSource: ds,

                enableRemoteLoadOnDemand: true,

                //dataSourceType: "json",

                //dataSourceUrl: myParam.getDataUrl,

                //initialExpandDepth: 1,

                columns: [

                    { headerText: "Column 1", key: "column1", dataType: "string" },

                    { headerText: "Column 2", key: "column2", dataType: "number", width: "*", template: "$${column2}" },

                    { headerText: "Column 3", key: "column3", dataType: "number", width: "*", template: "$${column3}" },

                    { headerText: "Column 4", key: "column4", dataType: "number", width: "*", template: "$${column4}" },

                ],

            };

            $("#treeItems").igTreeGrid(options);

Parents
No Data
Reply
  • 15320
    Offline posted

    Hello rsimm,

    Did you get any client side error while loading the child layout? Also could you please try using 'dataSourceUrl' option instead of 'dataSource' in the TreeHierarchicalDataSource definition on the root level?

    If the problem persists it would be great appreciated if you send me a sample that reproduces the issue and I can run on my side. Thanks in advance.

    Regards,

    Tsanna

Children