Unplanned
Last Updated: 27 Jul 2023 11:26 by Marcos
Marcos
Created on: 20 Jul 2023 17:01
Category: Grid
Type: Bug Report
1
Column Menu fails to display if Groupable is set to false

In the latest version (2023.2.718), the Column Menu in the Grid faild to open if you set the Groupable option to false.

To reproduce the issue simply change the line below in the Grid Overview Demo

.Groupable(g=>g.ShowFooter(false))

to the following:

.Groupable(false)

https://netcorerepl.telerik.com/cxkhGOvU52pBO4NK33

The error you get when clicking on the Column Menu is:

Uncaught TypeError: Cannot read properties of undefined (reading '_canDrag')
    at init._updateGroupColumns (kendo.all.js:321370:19)
    at init._open (kendo.all.js:321370:19)
    at init.trigger (kendo.all.js:321370:19)
    at init._trigger (kendo.all.js:321370:19)
    at init.open (kendo.all.js:321370:19)
    at init.toggle (kendo.all.js:321370:19)
    at init._click (kendo.all.js:321370:19)
    at HTMLAnchorElement.dispatch (jquery.min.js:3:12445)
    at r.handle (jquery.min.js:3:9174)

4 comments
Marcos
Posted on: 27 Jul 2023 11:26

Thank you very much for the feedback Alexander!

I've already implemented the workaround of omitting the grouping configuration. I'll follow the new issue you created for further feedback.

Thank you again!

King regards,

Marcos Silva

ADMIN
Alexander
Posted on: 27 Jul 2023 10:25

Hi Marcos,

Thank you for your patience. I have further received the green light from our developer's team that the reported behavior is indeed a bug and a regression introduced on our side. 

In this regard, we would personally like to thank you again for your conducted investigations, as indeed the issue stems from the evaluation that is made prior to invoking the "_updateGroupColumns()" as it only tackles a scenario where a raw boolean is expected to be configured.

Since we estimated that the behavior derives from the native client-side Grid widget, I have logged an additional GitHub issue within our public repository that further outlines the sporadical behavior.

You can track the item's status here:

https://github.com/telerik/kendo-ui-core/issues/7457 - I will personally make sure that both this feedback item and the GitHub issue are in-sync.

For the time being, I'm afraid that I cannot suggest another workaround other than omitting the Groupable configuration if grouping should be disabled. Or, explicitly altering the Grid's options programmatically by utilizing the setOptions() method and marking the "groupable" configuration explicitly to "false".

For further contributing with more than evident information regarding the issue, I have also updated your Telerik points as a token of appreciation.

Kind Regards,
Alexander
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
ADMIN
Alexander
Posted on: 27 Jul 2023 09:30

Hi Marcos,

Thank you for the exhaustive explanations and research that you have conducted on your side. Indeed, I completely agree with you that the reported behavior is indeed unorthodox and may comprise recent changes we have inducted for the accessibility of draggable elements.

Thus, I personally think that your suppositions regarding the culprit "if" clauses could be of the utmost accuracy. However, I have additionally reached out to our developer subject matter experts to further verify those suppositions and get their take on the matter as well.

I will update this thread shortly once I gather more intel from them.

Thank you for your patience and understanding in advance.

Kind Regards,
Alexander
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Marcos
Posted on: 21 Jul 2023 09:00

The error itself happens in the _updateGroupColumns() function (kendo.all.min.js) when it tries to call _canDrag() in the groupable property of the grid.

The problem is that groupable is undefined when the Grouping is disabled for the grid.

The root of the problem may be in the _open function. There, before calling _updateGroupColumns(), it checks if the groupable is enabled for the grid, but I believe that the check is incomplete.

If you do not call Groupable in the grid at all, then grid.options.groupable is undefined (and the check works). But if you call Groupable(false), the grid.options.groupable is defined and has an enabled=false property (and the check wrongly thinks that groupable is enabled).

Maybe the solution is to expand the check from "r.options.groupable&&r._updateGroupColumns()" to something like "r.options.groupable&&r.options.groupable.enabled&&r._updateGroupColumns()".

Or even changing it to "r.groupable&&r._updateGroupColumns()" since the _updateGroupColumns() uses the groupable property of the grid itself not of the options property.

I'm not great with javascript so this is a bit of a guess...