Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is my grid:

$("#myHtmlTable1").kendoGrid({
    dataSource: {
        pageSize: 18
    },
    scrollable: false,
    sortable: true,
    filterable: true,
    selectable: true,
    pageable: {
        input: false,
        numeric: false
    },
    change: function () {
        // MY LOGIC
    },
    columns: [
    {
        field: "Col1",
        width: 40
    },
    {
        field: "Col2",
        width: 250
    },
    {
        width: 40,
        field: "Col3"
    },
    {
        width: 150,
        field: "Col4"
    }
    ]
});

When I clic a row I get the row text and I put it in another textbox. But I want to do this only with left button mouse so that I can see the source code page using the right clic over the grid.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
234 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can attach the following keydown handler to the tbody element of the Grid when the document event is triggered to prevent the right click mousedown event from bubling and thus avoid the Grid reacting to it.

$(function(){
    $('#myHtmlTable1').data('kendoGrid').tbody.on('mousedown',function(e){
        if(e.button==2){
            e.stopImmediatePropagation()
        }
    })
})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...