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
155
igSplitter not showing igGrid
posted

Hello, im new to infragistics and im having trouble getting my igGrid to render properly in the second panel of my igSplitter. I followed the examples about the nested splitter and basic vertical splitter as best i could.

here is my code.

<div id="splitter">
<div><ul id="tree"></ul></div>
<div><table id="gridSplit"></table></div>
</div>

<script>

var list = [{
Text: "IgGrid",
ID: "1",
Data:
[{
Name: "data1",
Nid: "1",
Year: "1234"
},
{
Name: "data2",
Nid: "2",
Year: "1234"
},
{
Name: "data3",
Nid: "3",
Year: "1234"
},
{
Name: "data4",
Nid: "4",
Year: "1234"
}]
},
{
Text: "IgHiGrid",
ID: "2",
Data:
[{
Name: "data5",
Nid: "5",
Year: "1234"
},
{
Name: "data6",
Nid: "6",
Year: "1234"
},
{
Name: "data7",
Nid: "7",
Year: "1234"
},
{
Name: "data8",
Nid: "8",
Year: "1234"
}]
}];


$(function () {
$("#splitter").igSplitter({ height: "300px", panels: [{ size: 160, min: 100, max: 250 }] });
$('#tree').igTree({

dataSource: list,
dataSourceType: "json",
bindings: {
textKey: "Text",
valueKey: "ID",
childDataproperty: "Data"
}
});

$("#tree").on("igtreeselectionchanged", function (sender, eventArgs) {
var node = eventArgs.selectedNodes[0];
if (node.data.Data) {

$("#gridSplit").igGrid({
width: "100%",
height: "100%",
dataSource: node.data.Data,
dataSourceType: "json",
autoGenerateColumns: false,
primaryKey: "Name",
columns: [
{ headerText: "ID", key: "Nid", dataType: "number" },
{ headerText: "Name", key: "Name", dataType: "string" },
{ headerText: "year", key: "Year", dataType: "date" },
],

});
}

});

});

</script>

Any help or advice would be appreciated , thanks.

Parents Reply Children