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?
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?
Hi Ryan,
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)
rendered: function(evt){
$("#grid > tbody > tr > td").on("mouseleave", function(evt){
if(window.navigator.msPointerEnabled){
evt.stopPropagation();
}
});
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.
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’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.