jQuery UI Widgets Forums TreeGrid editOnSingleclick

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  ivanpeevski 12 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • editOnSingleclick #134154

    qx5
    Participant

    I want to enable editing for the TreeGrid by single-clicking on the list.
    I have used the following code:

    $(“#treegrid”).on(‘rowClick’, (event) => {
    $(“#treegrid”).jqxTreeGrid(‘beginCellEdit’, event.args.key, event.args.dataField);
    });

    When clicked for the first time, the cell properly enters the editing mode and selects all the text within the cell.
    But when I click on the text within the cell, attempting to position the mouse cursor, it triggers rowClick again, once more selecting all the text within the cell.
    So I will never be able to position the mouse cursor. Is there any solution to this?

    By the way, I noticed that when clicking on other non-editable columns in the same row and then returning to the editable column, the issue of repeatedly triggering rowClick disappears.

    Sorry, my English is not good.
    Thank you very much for your help

    editOnSingleclick #134160

    ivanpeevski
    Participant

    Hi qx5,

    You can create a “editActive” variable which keeps track of whether the editing is active. Then in the ‘rowClick’ event, start the editing only if editActive is false.
    Here is an example: https://jsfiddle.net/ptaf1qec/

    Best Regards,
    Ivan Peevski
    jQWidgets Support
    http://www.jqwidgets.com

    editOnSingleclick #134161

    qx5
    Participant

    I’m sorry, I forgot to explain.

    my editSettings like this:
    editSettings: {
    saveOnPageChange: true,
    saveOnBlur: true,
    saveOnSelectionChange: true,
    cancelOnEsc: true,
    saveOnEnter: true,
    editSingleCell: true,
    //editOnDoubleClick: true,
    editOnF2: true
    },

    Because it’s not row editing, but rather single-cell editing mode, the example above doesn’t seem to work.
    Is there any other way? Thank you very much

    editOnSingleclick #134179

    ivanpeevski
    Participant

    Hi qx5,

    Thanks for the feedback
    Here is an updated version – https://jsfiddle.net/k1xjmLsu/2/

    Best Regards,
    Ivan Peevski
    jQWidgets Support
    http://www.jqwidgets.com

    editOnSingleclick #134214

    qx5
    Participant

    https://jsfiddle.net/k1xjmLsu/2/

    Thank you very much for your help, but it seems there’s a small issue with this example.
    The cell enters the edit mode correctly on the first click.
    When I click for the second time, the cell enters a strange locked state, preventing any input.
    All subsequent clicks, however, work as expected.
    Is there a solution? Thank you very much

    editOnSingleclick #134234

    ivanpeevski
    Participant

    Hi qx5,

    Thanks for the feedback!
    Here is the updated solution – https://jsfiddle.net/pe2xvd3h/1/

    Best Regards,
    Ivan Peevski
    jQWidgets Support
    http://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.