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
465
Virtualization, groupby, and updating datasource with no rows will cause igGrid to go weird.
posted

I am using igGrid with virtualization and group by, and I noticed a strange behavior.  If virtualization is true, and grid is currently grouped by a column, updating the datasource with 0 rows, and then updating the datasource again with rows, the rows will not appear in grid until I remove the group by column.  Any idea why? Or any workaround for this?  I turned off virtualization, and everything works as expected, but this is not an option for us because we do have a lot of rows.  Here is a sample code that demonstrates this issue.

<script>
$(function () {

var data = [
{ "Name": "John Smith", "Age": 45 },
{ "Name": "Mary Johnson", "Age": 32 },
{ "Name": "Bob Ferguson", "Age": 27 }
];

$("#grid").igGrid({
dataSource: data,
virtualization: true,
virtualizationMode: "continuous",
height: "300px",
width: '100%',
autofitLastColumn: false,
autoAdjustHeight: false,
features: [
{ name: "GroupBy" }
]
});
});

function setDataSource() {
var data = [
{ "Name": "Test1", "Age": 1 },
{ "Name": "Test2", "Age": 2 },
{ "Name": "Test3", "Age": 3 }
];
$("#grid").igGrid("dataSourceObject", data);
$("#grid").igGrid("dataBind");
}

function clearDataSource() {
$("#grid").igGrid("dataSourceObject", []);
$("#grid").igGrid("dataBind");
}
</script>
</head>
<body>
<table id="grid"></table>
<BR>
<BR>
<button onclick="setDataSource()">
Set DataSource
</button>
<button onclick="clearDataSource()">
Clear DataSource
</button>
</body>
</html>

Once you load up the page, group by "Name" column, then click on "Clear DataSource" button, then click on "Set DataSource" button.  Notice no rows displaying, but if you ungroup, you will see rows, but if you group again, they disappear.

Thanks.

Parents
No Data
Reply
  • 15320
    Offline posted

    Hello michael_k_lui,

    I have investigated your issue, and I have asked our engineering staff to examine this further.  To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 220287.
    I've opened a private case for you with number: CAS-173929-W0M5K6 and have linked the development issue to it so that you'll be notified once the issue has been resolved.
    You can find the case by going to your account on our web site and then to the "Support activity" tab.
    You can view the status of the development issue connected to that case by selecting the "Development Issues" tab when viewing this case.
    Please let me know if you need more information.


    Regards,
    Tsanna

Children
No Data