Select dynamically generated element by id in Titanium Appcelerator -


i working latest tianium appcelerator , project using alloy.

i have tableview id: tblresults

in controller, populate table view rows this:

// dummy data var results = []; results.push({     title: 'hello world',     value: '123456' }); results.push({     title: 'bye world',     value: '654321' });  // build result data var resultdata = []; (var = 0; < results.length; i++) {     resultdata.push(createresultrow(         results[i].title,         results[i].value     )); }  // method create result row function createresultrow(mytitle, myvalue) {     var tablerow = titanium.ui.createtableviewrow({         height: 160         id: 'row-'+ myvalue     });     var tablerowview = titanium.ui.createview({         layout: 'horizontal'     });     var mybutton = titanium.ui.createbutton({         title: mytitle,         btnvalue: myvalue     });     mybutton.addeventlistener('click', function(e) {         handlebuttonclick(e);     });     tablerowview.add(mybutton);     tablerow.add(tablerowview);     return tablerow; }  // set table data $.tblresults.setdata(resultdata);  // method handle button click function handlebuttonclick(e) {     if (e.source && e.source.btnvalue) {         // how select row having id: 'row-'+ e.source.btnvalue ???     } } 

what is, generate dummy array of objects. using that, populate table view row has view, within there button.

what trying achieve is, when button clicked, want select table row having id this:

'row-'+ e.source.btnvalue

in pure javascript/jquery dom style, have done this:

$('#row-'+ e.source.btnvalue)

how can achieve in titanium appcelerator? there element selector functionality of sort in jquery?

this requested feature don't support, should. right now, you'd have keep hash of id -> view reference , way. however, opened feature request here https://jira.appcelerator.org/browse/timob-20286


Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

Hatching array of circles in AutoCAD using c# -