Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

accessing id via commonJS

$
0
0

hi,

i was wondering if its possible to create for example a button (in alloy) and give it an id of btnTest. Could i approach this button in my js file using commonJS ?

something like this:

˜˜˜˜

(function(){

if (require('platform').isTall()) {
    $.btnTest.addEventListener('click', function(e){
        var home = Alloy.createController('homescreen').getView();
        home.open();
    });
}   

$.winTopics.open(); 

})();

˜˜˜


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>