1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    10
    Vote Rating
    0
    fliptight is on a distinguished road

      0  

    Default Existing HTML and MVC

    Existing HTML and MVC


    sorry this is a repost from the Q&A thread but I didn't realize hardly anyone looks at that section (mods please feel free to delete my other thread). so back to the topic...



    MVC works great for getting the controller to listen to Ext JS components from the view and all, but say you have existing HTML like so:

    HTML Code:
    <body>    
        <div id="container">        
            <a href="#" id="testLink">Some Test Link</a>    
        </div>
    </body>
    how do you get the controller to listen to a click event from a normal link in the view without doing something hacky (imo) such at this?

    View
    Code:
    ...
        initComponent: function () {
            this.addEvents('testLinkClicked');
    
    
            Ext.get('testLink').on('click', function() {
                this.fireEvent('testLinkClicked');
            }, this);
    
    
            this.callParent();
        }
    ...
    Controller
    Code:
        init: function () {
            this.control({
                'test': {
                    'testLinkClicked': function() {
                        console.log('clicked link');
                    }
                }
            });
        }

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Posts
    10
    Vote Rating
    0
    fliptight is on a distinguished road

      0  

    Default


    no one has attempted anything a simple as this? =/

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