jQWidgets Forums

jQuery UI Widgets Forums Grid Edit disabled out of grid mouse focus

Tagged: 

This topic contains 8 replies, has 2 voices, and was last updated by  Martin 5 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Edit disabled out of grid mouse focus #107045

    giammarco88
    Participant

    Hi,
    I implemented a jqxgrid but I have a problem.
    When my mouse focus is out of grid, i can’t edit the cells. If my mouse focus is on grid, i can modify all fields.
    Could you help me to find the solution of my problem?

    Best regards,

    Giammarco

    Edit disabled out of grid mouse focus #107050

    giammarco88
    Participant

    Update.
    If i insert one grid in page all is right.
    When i insert a second grid, doesn’t work.

    Edit disabled out of grid mouse focus #107065

    Martin
    Participant

    Hello giammarco88,

    Could you send us a jsfiddle/codepen example where we could test and investigate this behavior?
    Thank you!

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

    Edit disabled out of grid mouse focus #107066

    giammarco88
    Participant

    Hi Martin,
    you will find an example file here:

    https://drive.google.com/open?id=1BBpsHAb7kn4EEOfM3-i006EWkiJJwVCm

    We try to use two grid in one homepage but there is a problem: we try to write in an edit column but when the mouse is positioned in the other grid, we can’t write anything (we can navigate the homepage but can’t write).
    We try to do this:

    • Selected one cell in upper grid
    • Move the mouse in the bottom grid
    • Try to write in upper grid

    Best regards,

    Giammarco Bergantino

    Edit disabled out of grid mouse focus #107070

    Martin
    Participant

    Hello Giammarco,

    Thank you for the example!

    You could bind to the mouseleave event of the grids and call the focus method if there is a selection:

    $("#grid1").on('mouseleave', (event) => {
       if ($("#grid1").jqxGrid('getselectedcells').length > 0) {                    
         $("#grid1").jqxGrid('focus');
       }
    });

    Here is your Example updated.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

    Edit disabled out of grid mouse focus #107072

    giammarco88
    Participant

    Thank you Martin,
    your modify works.
    We have another question:

    http://jsfiddle.net/Cala86/uqnk3hb9/3/

    In this example, the grid works, but if you do:

    1- Select cell of prices, it is read only, and when is selected try to write a number or letter (example 5)
    2- Select an edit cell, like “Name”

    When the cell is in edit mode, you find the value that you wrote in point 1 (example 5).

    Best regards,

    Giammarco

    Edit disabled out of grid mouse focus #107078

    Martin
    Participant

    Hello Giammarco,

    Thank you for the feedback! I will create a work item for this case.

    I would like to suggest you a workaround by binding to the cellbeginedit event and updating the value of the input to be the value of the cell.
    Here is an Example.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

    Edit disabled out of grid mouse focus #107084

    giammarco88
    Participant

    Hi Martin,
    thanks for your reply.
    You workaround works, but in our case, we can’t use.
    If you navigate with keyboard arrows, and you want change a value in “name” cell, when you try insert a letter, like “a”, you must push 2 times the key “a”.

    1- Select a cell that you want to modify with single click (ex. NAME)
    2- Push a letter on keyboard (Ex. a)

    The cell should change value with letter “a”, but in this case, enter in “edit mode” with old value.

    Have you got a solution?

    Best regards,

    Giammarco

    Edit disabled out of grid mouse focus #107105

    Martin
    Participant

    Hello Giammarco,

    Please, take a look at this Example.
    I’ve added a flag which shows, if the cell editing began with a key pressed or by a click and update its value only in the second case.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

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

You must be logged in to reply to this topic.