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

Enter Edit-Mode by doubleclick instead of single click

3 Answers 271 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 20 May 2012, 11:36 PM
hi there

can somebody point me to how i can get the grid to enter edit-mode by doubleclick instead of single click.
I think its a much more "natural" behaviour.

thanks in advance

3 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 21 May 2012, 05:04 PM
i think i´ve got it

set the grid to editable: false and add
$('#grid td').live('dblclick', function () {
    $("#grid").data("kendoGrid").editCell($(this));
    $(this).focusout(function () {
        $("#grid").data("kendoGrid").closeCell();
    });
});

 seems to work as hoped for.
0
Daniel
Top achievements
Rank 1
answered on 21 May 2012, 05:35 PM
with the above method kendo throws an "b._editContainer is null" error.
don´t know how to prevent that.
0
Daniel
Top achievements
Rank 1
answered on 24 May 2012, 11:28 AM
i little bit more improved
$('#grid td').live('dblclick', function (e) {
    if($(".k-grid-edit-row").length <= 0) {
        $("#grid").data("kendoGrid").editCell($(this));
        $(this).focusout(function() {
           if(!$("#grid").data("kendoGrid").select().hasClass("k-state-selected"))
                if(!$(".k-grid-edit-row input").hasClass("k-invalid"))
                    $("#grid").data("kendoGrid").closeCell();
        });
    }
});
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Share this question
or