If I configure the grid to allow row "delete", then when I am on a PC with a mouse, if I hover over a row I can see the delete icon (the "x"). On mobile devices, however, the delete icon doesn't appear very easily. If I click on the row itself the icon still doesn't appear. On my surface with IE, if I long hold it does appear and then works properly. On an iPad, if I click the row and then move my finger slightly left or right it finally appears and works properly.
How can I easily get the delete icon to appear whenever I select a row on a touch device?
Hello Ryan,
Thank you for posting in our forum!
For mobile devices, when edit mode is “cell”, the gesture that will show the delete button is swiping left or right.
For non-mobile devices where you operate with mouse and keyboard the delete button will display on hover.
For hybrid devices ( like Surface where you have both touch and mouse events) you can use both methods ( swipe when using the touch screen, or hover using the mouse).
You can find more details here:
http://www.igniteui.com/help/whats-new-in-2014-volume1#improved-delete-row-mobile
Let me know if you have any questions.
Best Regards,
Maya Kirova
Infragistics, Inc.
http://ko.infragistics.com/support
Should swipe still work if I want edit mode set to "None"? I want to be able to delete but not add or edit the rows/cells.
It looks like when I have it set to this, it works from the iPad but not from the Surface. I still have to long hold on the Surface to get the "x" to stay there. That wouldn't be that bad, except long holding also brings up a browser menu that I have to clear away and then I can hit the "x".
And actually the same is true even in cell and row edit mode. Swipe doesn't work on the Surface. Am I missing something?
FYI it does the same thing the sample referenced in what you sent me: http://www.igniteui.com/grid/basic-editing
From an iPad I can swipe in the above sample. From my Surface 4, swiping doesn't make the "x" stay visible. If I long hold, get the menu, click somewhere else to get rid of the menu, then the "x" stays and I can hit it and it properly marks the row for deletion. This is consistent with what I am seeing in my code as well but doesn't seem right to me.
I was able to reproduce this on Surface (IE browser). It seems that the button doesn’t stay visible when you swipe ( gets shown and then hides right away).
It seems to be a development issue introduced in 15.2. I have logged this behavior in our internal tracking system with a Development ID of 212834.
I’ve also opened a private case for you so that you can track the status of the development issue.
You can find the list of private cases associated with your account here:
https://ko.infragistics.com/my-account/support-activity
As a possible workaround until the issue is resolved I suggest handling the mouse leave event ( it is the event on which the delete button is typically hidden) and stopping it from bubbling up the dom so the grid won’t hide the button:
rendered: function(evt){
$("#grid > tbody > tr > td").on("mouseleave", function(evt){
//IE on touch has pointer events. If you want to limit the workaround’s behavior to just IE on touch you can add the following check.
if(window.navigator.msPointerEnabled){
evt.stopPropagation();
}
});
In this case when you tap on a row the button will show. I’ve attached a sample for your reference. I hope you find it useful.
Hi Ryan,
I’ve looked into this and it seems that they renamed the option that checks for pointer events on Edge so it’s:
window.navigator.msPointerEnabled – For IE
window.navigator.pointerEnabled – For Edge
So you can change the if statement as follows:
if(window.navigator.msPointerEnabled || window.navigator.pointerEnabled){
//workaround for IE and Edge on hybrid devices
Unfortunately we don’t have the same testing environment ( Surface + Edge) so I cannot confirm if it’ll work the same way but in theory it should work.
Let me know if you have any issues with the workaround on Edge.
Sorry hit send too soon. It sounded to me like you were saying IE and Edge should behave the same on the Surface, but I am not seeing that.
I was using Edge on the Surface. I just tried now with IE on the surface and it worked as you said it would. That seems different than what you are saying it should do though.
Are you testing in on IE, Edge or some other browser?
For other browsers you can remove the if statement as it only applies to browsers that have pointer events ( like IE and MS Edge)
Thanks for the response.
Using your sample on my Surface 4, it doesn't behave any differently than before. If I click on a row, I see the "x" button for a bit but then it goes away. If I long hold, the menu comes up, and then if I click somewhere else the menu goes away and the "x" button stays. It's basically the same as it was before. Am I missing something?