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

how to add menu inside a grid column using template

1 Answer 357 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pradeep
Top achievements
Rank 1
Pradeep asked on 16 Sep 2014, 06:51 AM
how to add menu inside a grid column using template .. ??

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 18 Sep 2014, 06:51 AM
Hello Pradeep,

You can use the following approach:

$("#grid").kendoGrid({
    dataBound: function (e) { e.sender.tbody.find(".myMenu").kendoMenu(); },
    scrollable: false,
    columns: [{
        }, {
            title: "Menu",
            template: '<ul class="myMenu"><li>item 1<ul><li>sub item 1</li></ul></li></ul>'
        }
    ]
});

There are several things to note:

1. You can't use an ID for the Menus, unless you make sure the ID is different for each row.
2. If the Menu will have expandable sub items, then Grid scrolling should be disabled, and the following CSS rule should be added:

#grid td
{
    overflow: visible;
}

3. If you want to prevent the Menu from expanding horizontally to 100% of the cell width, then use:

#grid .k-menu
{
    display: inline-block;
    border-right-width: 0;
}


Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Pradeep
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or