RadContextMenu - iPad Safari (Right Click?)

15 posts, 0 answers
  1. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 09 Sep 2010 Link to this post

    So some of our end users have brought to light that they can't access our context menus via Safari on the iPad. I'm assuming this is an issue with no Right Click being available. I've attempted to figure out how to right click (double tap, two finger tap, long hold tap, etc.) but nothing seems to work... does anyone know how to perform a Right Click? If not, any ideas on how to resolve this? I guess we could simulate a long tap check with Mouse Down and Mouse Up...
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 13 Sep 2010 Link to this post

    Hello Xorcist,

    Unfortunately double click in iOS Mobile Safari is hardwired to zoom and can't be prevented. Since two finger tap is not very precise, I'm attaching an example of how to show a RadContextMenu with a tap and hold on a RadTreeView node.

    Sincerely yours,
    Kamen Bundev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 14 Sep 2010 Link to this post

    Well, with the

    if ($telerik.isMobileSafari) {
    }

    block the code does nothing... I assume maybe the version of the controls I'm using, 2009Q2, this was iPhone related and not iPad related (since the iPad wasn't around yet). Removing this check did allow the popups to show. So now I just need to tweak it a little. On a similar note, we just received our development iPad and I noticed that Safari uses double click to zoom out... any way to overried that at all. I have double click operation in my page as well.

    Thanks.
  5. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 14 Sep 2010 Link to this post

    Oh, I just found these too, based off the code sample you provided:

    http://mydailyphoto.com/blog/iphone-safari-flick-navigation/

    http://developer.apple.com/library/safari/#documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/InteractiveVisualEffects/InteractiveVisualEffects.html

    I wasn't aware these existed. This should help me out a little, but if you do know of a way to suppress the double tab "zoom-in" I would like to know about it. Every year it gets harder and harder to get cross-platform compatability...
  6. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 14 Sep 2010 Link to this post

    Hello Xorcist,

    Yes, the $telerik.isMobileSafari was introduced in Q2 2010 release. This variable is based essentially on the same check, you can use it instead:
    var isMobileSafari = (navigator.userAgent.search(/like\sMac\sOS\sX;.*Mobile\/\S+/) != -1);

    Sincerely yours,
    Kamen Bundev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Michael Constantine
    Michael Constantine avatar
    18 posts
    Member since:
    Jan 2006

    Posted 28 Jan 2011 Link to this post

    How would you apply this to a Row in a radgrid ?
  8. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 03 Feb 2011 Link to this post

    Hello Michael,

    I'm attaching a sample implementation of long touch event for RadGrid row context menu.

    Kind regards,
    Kamen Bundev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  9. Jody Harbour
    Jody Harbour avatar
    17 posts
    Member since:
    Feb 2009

    Posted 13 Oct 2011 Link to this post

    I am looking to do something similar but I am just using a contextmenu on the page

    <telerik:ContextMenuElementTarget ElementID="MasterContainer" />


    how would I do this for that.
  10. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    540 posts

    Posted 24 Oct 2011 Link to this post

    Hello Jody Harbour,

    The solution is more or less similar, but instead attaching event on a RadGrid, you attach the event to the body element.

    So if you take a look at the code, around line 47 there is a pageLoad function. In that function you need to change the "owner" of the addEventListener from gridArea to document.body or a variable referencing it.

    Kind regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  11. Dave
    Dave avatar
    11 posts
    Member since:
    Dec 2011

    Posted 29 Feb 2012 Link to this post

    So how would I handle a RadFileExplorer open file event? i would want to replace the double click event
  12. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    540 posts

    Posted 07 Mar 2012 Link to this post

    Hello, Dave.

    This tread is kind of stale and with your question being quite short, I am not quite sure what to answer.

    I could point you to the page for client events of the FileExplorer -- http://www.telerik.com/help/aspnet-ajax/fileexplorer-client-side-events.html -- but I am not sure it will be enough.

    You could however, open a new ticket (this thread is long and old enough) with a little bit more information and will see what can be done.

    Regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. Phil
    Phil avatar
    84 posts
    Member since:
    Apr 2005

    Posted 20 Aug 2012 Link to this post

    Is this thread "stale" inthat the solution deson't work any more? I tried it on iPad3 and get nothing.

    Ah, made the change to the method call posted elsewhere (_raiseAppointmentContextMenu) and it works.

    But in doing so you disable drag and drop? There is no way of having drag and drop AND context menu? 

  14. Himanshu
    Himanshu avatar
    4 posts
    Member since:
    Oct 2012

    Posted 29 Aug 2012 Link to this post

    Hi, 
    After looking at the attached codes I able to have context menu on my RadScheduler on single touch across the schedular grid for following sample code on IPAD->

    <telerik:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
                <Items>
                    <telerik:RadMenuItem Text="New PlaceHolder" Value="CommandAddAppointment" />
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Text="Paste Placeholder" Value="" />
                </Items>
            </telerik:RadSchedulerContextMenu>


    But I am not able to work for any of the context menu item (e.g "New PlaceHolder") as my "sender.get_selectedSlots()" is not firing properly ( Now I am not able to select any cell as on every click my context menu open without selecting any cell on schedular grid).

    I am looking for value in function ::

            function GetSelectedTimeSlot(sender) {
    
    var selected = sender.get_selectedSlots(); // slots are not getting selected
                var counter = 0;
                startSlot = null;
                endSlot = null;
                for (var slot in selected) {
                    if (counter == 0) {
                        startSlot = selected[counter];
                    }
                    endSlot = selected[counter];
                    counter++;
                }
  15. Maneesh
    Maneesh avatar
    6 posts
    Member since:
    Feb 2014

    Posted 19 Aug 2015 Link to this post

    Hi,

      I want to open the context menu with an html div element, not with the  grid or treeivew.

    Can you please explain how do I need to change in the sample code given above.

  16. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    540 posts

    Posted 24 Aug 2015 Link to this post

    Hi, Maneesh.

    You can use any external library that supports long touch. The example below uses Longpress:

    <%@ Page Language="C#" %>
     
    <!DOCTYPE html>
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
        <style>
            #target {
                width: 100px;
                height: 100px;
                background: red;
            }
        </style>
    </head>
    <body>
    <form id="form1" runat="server">
     
     
        <asp:ScriptManager runat="server" />
     
     
        <div id="target"></div>
     
     
        <telerik:RadContextMenu runat="server" Visible="true" ID="contextmenu" RenderMode="Lightweight">
            <Items>
                <telerik:RadMenuItem Text="Item 1" />
                <telerik:RadMenuItem Text="Item 2" />
                <telerik:RadMenuItem Text="Item 3">
                    <Items>
                        <telerik:RadMenuItem Text="Item 3.1" />
                        <telerik:RadMenuItem Text="Item 3.2" />
                        <telerik:RadMenuItem Text="Item 3.3" />
                    </Items>
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Item 4" />
                <telerik:RadMenuItem Text="Item 5" />
            </Items>
        </telerik:RadContextMenu>
     
     
     
     
        <script>
        Sys.Application.add_load(function() {
     
            var $ = window.$;
            var menu = $find( "<%= contextmenu.ClientID %>" );
     
            $("#target").longpress(function() {
                menu.showAt( 0, 0 );
            });
     
        });
        </script>
     
     
    </form>
    </body>
    </html>

    The longpress project is located at github: https://github.com/vaidik/jquery-longpress

    The shorts of it is that you attach the longpress (touch and hold) event to the div and then in the handler you show the menu at the desired location.

    Regards,
    Ivan Zhekov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017