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

Enter Edit-Mode by doubleclick instead of single click

3 Answers 770 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 26 Jul 2018, 01:59 PM

Hi,

I want to make a cell editable on double click instead of single click. I know this can be achieved by jQuery. But still do we have any option in kendo grid.

Thanks in Advance,

Sam

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Jul 2018, 04:56 AM
Hi Sam,

You can achieve this requirement using the editCell method provided by the grid. You can find a similar sample here:
https://docs.telerik.com/kendo-ui/knowledge-base/grid-edit-cell-on-double-click

And if you want to achieve the same for other edit modes, you can use the approach demonstrated here:
https://docs.telerik.com/kendo-ui/knowledge-base/grid-open-edit-popup-on-double-click-of-row

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sam
Top achievements
Rank 1
answered on 16 Aug 2018, 09:10 AM

Hi Eyup,

Thanks. Now I'm able to enable editable field by double click.

We are planning to enable editable field also on any valid character key press and want to retain the pressed character in the editable field. But this is not achievable since it takes some time to render editable field. Please guide us if we can do this in any other way.

Thanks in advance,

Sam Azpan. D

 

0
Tsvetina
Telerik team
answered on 20 Aug 2018, 07:38 AM
Hi Sam,

This may be possible to achieve based on the field editors that you have. If all columns in your Grid are strings and you have simple text editors, you can try the following:
1. When you capture the key press event and check what letter was pressed, save this letter in a variable that is accessible to the Grid event handler functions.
2. Add an edit event handler to the Grid. When you call editCell to make the cell editable, this event will be raised jut before showing the cell content.
3. In the edit  event handler, you can search for the edited input and set its value to the letter that you previous saved:
function onEdit(e){
    var input = e.container.find("input.k-textbox");
    input.val(savedLetter);
    input.trigger("change"); // if you want the value to be immediately reflected in the underlying data item
}

If you have other editors like DatePickers or NumericTextBoxes, you will need to run additional checks to know what type of editor you need to be setting the current value to.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Sam
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or