Hybrid View

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    bhakta is on a distinguished road

      0  

    Default Overlay near mouse click

    Overlay near mouse click


    I am relatively new to this forum. Trying to understand overlays. Is there an API method that shows overlay panel near mouse/touch position like overlayPanel.showBy(X, Y, 'lc-lc?')?

  2. #2
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    Have you reviewed the Panel class? The first example in the docs relates to its use as an overlay. There is a showBy method too but it is in relation to another component.

    http://sencha/touch/sencha-touch-2.1...-method-showBy

    If that doesn't suit you and you truly want to show an overlay in relation to the touch position, please post more details on what you're trying to accomplish as well as any relevant code.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    83
    Vote Rating
    11
    Schildi will become famous soon enough

      0  

    Default


    Hi bhakta,

    I quickly developed a senchafiddle: http://www.senchafiddle.com/#P3VCq

    Maybe you can use this as a first step and some inspiration (supposed that this is what you asked for)?

    Best regards,
    Schildi

  4. #4
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    bhakta is on a distinguished road

      0  

    Default


    Schildi, Yeah that is what I want. But here is a challenge. I am using a List and touch has to happen inside ListItem. The itemTap functions here are not giving me event object to locate touch coordinates. I don't know if this works out if I add List to another panel and add tap listener to the parent panel. But I liked your solution. Will try that out. Thanks.

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    83
    Vote Rating
    11
    Schildi will become famous soon enough

      0  

    Default


    Oh, itemtap does give you an event object.
    http://docs.sencha.com/touch/2-0/#!/...-event-itemtap

    Code:
    itemtap: function(list, index, target, record, e, eOpts) {
        var x = e.pageX;
        var y = e.pageY;
                        
       // show the panel and stuff...
    }
    Tip: you can check the different params by logging its values in the console:
    Code:
    itemtap: function(list, index, target, record, e, eOpts) {
        console.log(list);
        console.log(index);
        console.log(target);
        console.log(record);
        console.log(e);
        console.log(eOpts);
    }
    Best regards,
    Schildi

Thread Participants: 2

Tags for this Thread