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",
autoGenerateColumns: false,
dataSource: ds,
//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);
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
I initially tried dataSourceUrl. When it is used, no AJAX call is made at all. It is thoroughly discussed in this thread.
I have attached a sample.Do you have a sample that uses load on demand from javascript (without using the MVC Helpers) that works?