1. #1
    Sencha User
    Join Date
    Feb 2009
    Location
    India
    Posts
    69
    Vote Rating
    1
    arvindwill is on a distinguished road

      0  

    Default Unanswered: Get the parent object of Ext.draw.Sprite

    Unanswered: Get the parent object of Ext.draw.Sprite


    How to get the parent (Ext.draw.Component) for a sprite which referenced was recived from the mouse event.

    It dont have up() method, as it is not component. And it is useless to use the element's up method .
    Code:
    element.el.up('draw')
    Any other way to find the Ext.draw.Component for a sprite from its reference.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The up method on an element is not going to resolve a component, it's going to try and resolve elements.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2009
    Location
    India
    Posts
    69
    Vote Rating
    1
    arvindwill is on a distinguished road

      0  

    Default


    Sorry, can you explicitly tell how to retrieve the component from sprite object?

    Thanks

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,904
    Answers
    369
    Vote Rating
    178
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Try this. If you change the draw component's baseCls then '.x-surface' won't work - you'd need to use whatever you changed the baseCls to, but if you don't change it this should get you the draw component for the clicked (or whatever mouse event) sprite.

    Code:
    var drawComponent = Ext.create('Ext.draw.Component', {
        viewBox: false,
        items: [{
            type: 'circle',
            fill: '#79BB3F',
            radius: 100,
            x: 100,
            y: 100
            , listeners: {
                click: function (sprite, e) {
                    console.log(Ext.getCmp(sprite.el.up('.x-surface').id));
                }
            }
        }]
    });

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi