简体   繁体   中英

remove the column header menu in the locked columns from the Kendo Grid

I want to remove the column header menu in one of the locked columns in my kendo grid. i have tried the bellow but it only works for the columns that are not locked.

 function removeColumnheaderMenu(gridId) { var grid = $(gridId).data("kendoGrid"); grid.thead.find("[data-field=lockedColumnIwantToRemove]>.k-header-column-menu").remove(); } 

here is a possible solution for you.

http://dojo.telerik.com/exAje

var menuItems =  $("div.k-grid-header-locked").find("a.k-header-column-menu");

          console.log(menuItems);

          if(menuItems !== null && menuItems.length > 0) 
          {
            menuItems.each(function(){
              $(this).remove();
            });
          }

        });

all this does is inspect the locked side of the grid and then checks to see if there is a column menu link and then removes any it finds.

If you need any more details on what this is doing or need it modifying to be a bit more robust give me a shout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM