How to custom tooltip such as contains some button in grid's cell tooltip in Kendo UI MVC?

flower

In the cell's tooltip,I want to add some button or menu,such as open button.When I hover the mouse above the cell,the tooltip shows the button.When I click the button,it will open a window. Can Kendo grid can do that?

Lars Höppner

Here's how you would do it with JS; all you need to do is use the appropriate MVC wrappers (Html.Kendo().Grid(), @(Html.Kendo().Tooltip() and Html.Kendo().Window() (although you may need to use plain JS for the window if you want to use the jQuery click event)):

Grid:

var grid = $("#grid").kendoGrid({
    dataSource: dataSource,
    columns: [{
        field: "Id",
        title: "Id",
        filterable: false
    }, {
        field: "StatusText",
        title: "String value"
    }, {
        field: "ToolTip",
        title: "Tool tip column",
        template: "<span class='tooltip'>#= data.ToolTip #</span>"
    }]
}).data("kendoGrid");

Tooltip:

var currentDataItem;
var toolTip = $('#grid').kendoTooltip({
    filter: ".tooltip",
    content: function (e) {
        var row = $(e.target).closest("tr");
        currentDataItem = grid.dataItem(row);
        return "<div>Hi, this is a tool tip for id " + currentDataItem.Id + "! <br/> <button class='open'>Open window</button></div>";
    }
}).data("kendoTooltip");

Window:

$(document).on("click", ".open", function () {
    var currentContent = currentDataItem.get("StatusText");
    $("<div>Current status: " + currentContent + "</div>").kendoWindow({
        modal: true
    }).getKendoWindow().center().open();
});

(demo)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to custom tooltip such as contains some button in grid's cell tooltip in Kendo UI MVC?

From Dev

Kendo UI - Tooltip in a grid

From Dev

Kendo UI - Tooltip in a grid

From Dev

Kendo UI: Conditionally preventing a Tooltip from being displayed on a Grid cell

From Dev

kendo ui tooltip for custom command

From Dev

Can I change the tooltip's default action of Kendo UI grid in MVC?

From Dev

Positioning issue with kendo ui tooltip inside a grid

From Dev

How to put tooltip description in each header cell ui-grid

From Dev

Add Custom Data To Kendo UI Calendar For Tooltip

From Dev

How to disable Jquery UI dialog close button's tooltip?

From Dev

Kendo UI grid filter cell that contains an array

From Dev

Kendo UI grid filter cell that contains an array

From Dev

how to display kendo tooltip for kendo grid column menu

From Dev

How to change the background of a cell dynamically in a Kendo MVC UI Grid?

From Dev

Kendo UI Tooltip remove/destroy?

From Dev

Kendo UI Tooltip remove/destroy?

From Dev

Kendo UI - Displaying images in a tooltip

From Dev

Kendo UI chart tooltip and redraw

From Dev

Kendo UI: How to set the value of a tooltip with a MVVM binding

From Dev

How to style Material-UI's tooltip?

From Dev

How to display button in tooltip

From Dev

Display Custom Command Button Kendo UI Grid in MVC with Conditional Authorization Role

From Dev

Jquery UI tooltip on disabled button

From Dev

How to retroactively add a UI Bootstrap Tooltip to some SVG elements?

From Dev

Kendo UI Tooltip on show, access target?

From Dev

Kendo UI, How to manually call validate() on kendo grid cell

From Dev

Kendo UI, How to manually call validate() on kendo grid cell

From Dev

kendo chart tooltip custom position on plot area

From Dev

Kendo UI Grid cell coloring in MVC4

Related Related

  1. 1

    How to custom tooltip such as contains some button in grid's cell tooltip in Kendo UI MVC?

  2. 2

    Kendo UI - Tooltip in a grid

  3. 3

    Kendo UI - Tooltip in a grid

  4. 4

    Kendo UI: Conditionally preventing a Tooltip from being displayed on a Grid cell

  5. 5

    kendo ui tooltip for custom command

  6. 6

    Can I change the tooltip's default action of Kendo UI grid in MVC?

  7. 7

    Positioning issue with kendo ui tooltip inside a grid

  8. 8

    How to put tooltip description in each header cell ui-grid

  9. 9

    Add Custom Data To Kendo UI Calendar For Tooltip

  10. 10

    How to disable Jquery UI dialog close button's tooltip?

  11. 11

    Kendo UI grid filter cell that contains an array

  12. 12

    Kendo UI grid filter cell that contains an array

  13. 13

    how to display kendo tooltip for kendo grid column menu

  14. 14

    How to change the background of a cell dynamically in a Kendo MVC UI Grid?

  15. 15

    Kendo UI Tooltip remove/destroy?

  16. 16

    Kendo UI Tooltip remove/destroy?

  17. 17

    Kendo UI - Displaying images in a tooltip

  18. 18

    Kendo UI chart tooltip and redraw

  19. 19

    Kendo UI: How to set the value of a tooltip with a MVVM binding

  20. 20

    How to style Material-UI's tooltip?

  21. 21

    How to display button in tooltip

  22. 22

    Display Custom Command Button Kendo UI Grid in MVC with Conditional Authorization Role

  23. 23

    Jquery UI tooltip on disabled button

  24. 24

    How to retroactively add a UI Bootstrap Tooltip to some SVG elements?

  25. 25

    Kendo UI Tooltip on show, access target?

  26. 26

    Kendo UI, How to manually call validate() on kendo grid cell

  27. 27

    Kendo UI, How to manually call validate() on kendo grid cell

  28. 28

    kendo chart tooltip custom position on plot area

  29. 29

    Kendo UI Grid cell coloring in MVC4

HotTag

Archive