Approved
Last Updated: 05 Nov 2019 07:49 by ADMIN
Michael D
Created on: 09 Oct 2019 08:17
Category: DropDownList
Type: Bug Report
0
Fixed Group Template is displayed when there is no data

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

3 comments
Missing User
Posted on: 05 Nov 2019 07:49

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Michael D
Posted on: 04 Nov 2019 09:51

While this workaround probably works for now, I would prefer it if you fix this in your product.

Missing User
Posted on: 09 Oct 2019 13:03

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.