Prevent View Opening Kendo

时间:2015-06-26 10:18:57

标签: javascript asp.net asp.net-mvc kendo-ui

In my aspx, Using a Kendo Gantt, I need to prevent the opening of the view that edit the task JUST when I double click on the third column of the Gantt "Grid".

This is my JS, how can I do that?

Regards

<script type="text/javascript">
    $(function (e) {
        $(".k-gantt").on("dblclick", ".k-gantt-treelist .k-grid-content tr", function () {
            var uid = $(this).attr("data-uid");
            e.preventDefault();
            if (uid) {
                $("#gantt").data("kendoGantt").editTask(uid);
            }
        });

    });
</script>

2 个答案:

答案 0 :(得分:0)

您可以排除第3列触发点击事件的功能。

$(".k-gantt").on("dblclick", ".k-gantt-treelist .k-grid-content tr :not(td:nth-child(3))", function () {
    var uid = $(this).attr("data-uid");
    e.preventDefault();
    if (uid) {
        $("#gantt").data("kendoGantt").editTask(uid);
    }
});

答案 1 :(得分:0)

解决了这个问题:

        var currentObj = $(event.target);
        var colID = $(currentObj).closest('td').index();

        if(colID != 2) {
            if (uid) {
                $("#gantt").data("kendoGantt").editTask(uid);
            }