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>
答案 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);
}