I am using a DropDownList with dynamic items that are grouped.
When opening the dropdown without items in the datasource the fixed group header is displayed empty.
When removing the last item from the datasource after the DropDown has already been opened, the first group header is still displayed when opening the dropdown.
I would expect the group header to never be displayed if there is no data.
See Dojo: https://dojo.telerik.com/EviPepIJ
Hello Michael,
I have converted this ticket to a Bug Report and logged the item in the public GitHub repository. You could start tracking the progress here:
Should you have any further questions please let me know.
Regards,
Aleksandar
Progress Telerik
While this workaround probably works for now, I would prefer it if you fix this in your product.
Hello Michael,
If I understand correctly the reported behavior occurs once the dataSource for the widget is loaded and the data dynamically deleted afterwards. Once the last item is deleted in this manner the noDataTemplate is rendered. However, as there are not items it the DropDownList does a check for the grouped items is not performed, thus the fixed header remains visible.
To resolve the issue you can add a check on the items in the DropDownList dataSource and clear the grouping once no items remain in the dataSource:
$('#btn').on('click',function(){
var ddl = $("#customers").getKendoDropDownList();
var ds = ddl.dataSource;
ds.remove(ds.at(0))
ds.sync();
if(!ds.data().length) {
ds.group([]);
}
});
You can review the above suggestion in this dojo. Let me know if the suggested approach works for you.
Regards,
Aleksandar
Progress Telerik