Unplanned
Last Updated: 21 Feb 2021 06:17 by fereshteh
fereshteh
Created on: 19 Feb 2021 15:05
Category: Grid
Type: Bug Report
1
data-menu is returning a string instead of a boolean

Bug report

When a Kendo UI Grid has been initialized via a table, If the user sets the th element with data-menu="false", the menu attribute is read as a string instead of a boolean.

Reproduction of the problem

  1. Go to this Progress Kendo UI Dojo.
  2. The make and model have data-menu="false". But the column menu contains both columns.

Expected/desired behavior

The data-menu configuration should be parsed to a boolean.

Environment

  • Kendo UI version: 2021.1.119
2 comments
fereshteh
Posted on: 21 Feb 2021 06:17

hi again . thank you soo much for creating this feed back and your answer . as i was in hurry to fix that problem in our project , I exactly implemented this behavior but your code is mush cleaner than mine so i will use this code.

regards,

Fereshteh

 

ADMIN
Patrick
Posted on: 19 Feb 2021 15:18

Hi Fereshteh,

I wanted to share the workaround for now in this bug report for those having the same issue.  

Using the columnMenuInit event, configure the columnMenu based on the data-menu string property:

          function onColumnMenuInit(e){

            //Avaliable Grid columns
            var columns = e.sender.columns;

            //get menuItem inputs
            var inputs =  $(e.container).find("input");

            for(var x = 0; x < columns.length; x++){

              //if the column's menu property is set to false
              if(columns[x].menu == "false"){

                //hide the parent span of the input
                $(inputs[x]).parent("span").hide();
              }
            }
          }

Please take a look at this updated Progress Kendo UI Dojo for a live example of the implementation above.

Regards,
Patrick
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.