jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Stop text selection after double click
Tagged: datagrid selection multiple rows, grid
This topic contains 9 replies, has 4 voices, and was last updated by ajcs 5 years, 4 months ago.
-
Author
-
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
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 HristovjQWidgets team
https://www.jqwidgets.comYes 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.
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,
PeterThanks 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?
Hi ajcs,
Could you provide an example which reproduces this?
Regards,
PeterHave you looked at the example above? Any ideas how to fix it?
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,
PeterThank you very much. That fixed the problem. It still occasionally did it so I increased the delay to 250 and now is working well.
-
AuthorPosts
You must be logged in to reply to this topic.