This is a migrated thread and some comments may be shown as answers.

How do you customize kendoUI Grid Column Menu for Mobile

4 Answers 285 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 2
Joseph asked on 06 Feb 2016, 03:28 PM

I have a more detailed look at what I'm trying to do here (http://stackoverflow.com/questions/35158369/how-do-you-customize-kendoui-grid-column-menu-for-mobile), this is the only thing stopping me right now from using the GRID.

 After looking around for desktop mode I found how to modify the column menus.

 columnMenuInit: function (e) { console.log("menu init");var field = e.field; console.log(field);var menu = e.container.find(".k-menu").data("kendoMenu"); menu.append([{text: "Highlight", spriteCssClass: "k-i-custom", content: '<div class="colorpicker' + field + '"></div>'}]); $(".colorpicker" + field).kendoFlatColorPicker({ preview: false, value: "#000", change: select});};

 

However, this does not work for mobile when mobile:true is set for the grid (A.K.A adaptive rendering mode).  How would I customize the menu for the mobile version?

4 Answers, 1 is accepted

Sort by
0
Joseph
Top achievements
Rank 2
answered on 06 Feb 2016, 05:59 PM
Another way of asking my question is by refering to the documentation here (http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-columnMenuInit), except how do I follow the example it provides but for the mobile version of the grid columns?
0
Joseph
Top achievements
Rank 2
answered on 10 Feb 2016, 01:06 AM
Anyone have any ideas?
0
Rosen
Telerik team
answered on 11 Feb 2016, 09:14 AM

Hello Joseph,

There is no Kendo Menu widget embedded in the column menu when mobile rendering is used. Thus, it will require a different approach than when non-mobile mode is used. For example functionality similar to the one demonstrated in the article you have reference could look similar to the following:

columnMenuInit: function(e) {                          
    $("<li><span class='k-link'>Custom</span></li>")
      .appendTo($(e.container).children().first())
        .click(function() {
        console.log("Custom is clicked");
        });
}

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Joseph
Top achievements
Rank 2
answered on 11 Feb 2016, 07:13 PM
Thanks, this is what I was looking for! Much appreciated!
Tags
Grid
Asked by
Joseph
Top achievements
Rank 2
Answers by
Joseph
Top achievements
Rank 2
Rosen
Telerik team
Share this question
or