jQWidgets Forums

jQuery UI Widgets Forums Grid Stop text selection after double click

This topic contains 9 replies, has 4 voices, and was last updated by  ajcs 5 years, 4 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Stop text selection after double click #108336

    ajcs
    Participant

    On the grid double click event I am running code which opens a new browser tab. When I return to this tab it appears to be in the middle of text selection with the mouse dragging round the expanding selection window.

    Is there a way to stop this selection after the double click (might not want to turn off text selection totally)?

    Thanks


    Hristo
    Participant

    Hello ajcs,

    Could you clarify it?
    If you have selected some rows (cells) use the unselect methods.
    Or if you have some plain text selected just clear the selection.
    Please, take a look at this topic.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Stop text selection after double click #108380

    ajcs
    Participant

    Yes I will try to clarify this to you more.

    Yes I have a row selected and I want to keep it selected. When I double click on a row I am running code that opens another browser tab.

    The problem is when I return back to this browser tab the mouse is dragging round the elastic band selection box like it is half way through trying to select an area of screen.

    So it looks like the double click has started some kind of drag and select process, maybe because I opened a new tab?

    I looked at that other article but I’m not sure it helps.


    Peter Stoev
    Keymaster

    Hi ajcs,

    The grid has one property called enablebrowserselection. The property is boolean so it accepts true or false values. Make sure that this property is set to false.

    Hope this helps.

    Regards,
    Peter


    ajcs
    Participant

    Thanks but I found the problem happens with selectionmode = multiplerowsextended

    Then the rubber banding happens.

    You can see this if you go to your grid demos and look at the “Data Export” example. If you click on the mouse and hold and drag you can see an expanding blue box on the screen. Now this is what happens when I double click and open a new browser tab. When I come back the mouse is still dragging this blue box around.

    I need to use selectionmode = multiplerowsextended so is there a way to fix this problem please?


    admin
    Keymaster

    Hi ajcs,

    Could you provide an example which reproduces this?

    Regards,
    Peter

    Stop text selection after double click #111438

    ajcs
    Participant

    Yes here is a working example of the problem

    Example


    ajcs
    Participant

    Have you looked at the example above? Any ideas how to fix it?

    Stop text selection after double click #111472

    admin
    Keymaster

    Hi ajcs,

    I looked at the provided example. The solution is to put your window.open code in a timeout like that:

    	$('#jqxgrid').on('rowdoubleclick', function (event) {
    					setTimeout(() => {
              window.open("https://www.ajcsoft.com");
              }, 100)
        });     

    By doing that the Grid will be able to handle its logic on pointer up.

    Regards,
    Peter


    ajcs
    Participant

    Thank you very much. That fixed the problem. It still occasionally did it so I increased the delay to 250 and now is working well.

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

You must be logged in to reply to this topic.