Enter Edit-Mode by doubleclick instead of single click

4 posts, 0 answers
  1. Sam
    Sam avatar
    4 posts
    Member since:
    Aug 2015

    Posted 26 Jul 2018 Link to this post

    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

  2. Eyup
    Admin
    Eyup avatar
    4046 posts

    Posted 29 Jul 2018 Link to this post

    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.
  3. Sam
    Sam avatar
    4 posts
    Member since:
    Aug 2015

    Posted 16 Aug 2018 Link to this post

    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

     

  4. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 20 Aug 2018 Link to this post

    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.
Back to Top