Picker Control inside TableViewRow
Not able to get the click events in the Picker, meaning I cannot select any of the items.
I have uploaded a functional app.js here
I am also getting this error message
2010-11-19 01:48:06.694 ocil[21322:207] -[UIPickerView setFrame:]: invalid height value 217.0 pinned to 216.0
2010-11-19 01:48:06.741 ocil[21322:207] -[UIPickerView setFrame:]: invalid height value 217.0 pinned to 216.0
3 Answers
-
Hi Aaron
I am sorry that it has taken a while to get back to you, but this completely slipped my mind.
I had to take a guess at what your objectives are. I hope this moves you a step closer to your goal. Certainly, the click events work in this version.
Ti.UI.setBackgroundColor('#000'); var win1 = Ti.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var tvData = []; var detailTableView = Ti.UI.createTableView( { // style : Ti.UI.iPhone.TableViewStyle.GROUPED, // visible : true, // width : '100%', // height : '100%', // scrollable : false, touchEnabled : false, allowsSelection : false }); win1.add(detailTableView); for ( var j = 0, jlen = 10; j<jlen; j++){ var l1 = Ti.UI.createLabel( { text : "THIS IS QUESTION "+j, font :{fontSize:18}, left : 5 }); var row = Ti.UI.createTableViewRow( { className : "row2" }); row.add(l1); var rowNum = 0; tvData.push(row); var pickerData = []; var choices = ["Choice 1", "Choice 2"]; for ( var i = 0, ilen=choices.length; i <ilen ; i++){ var thisPickerRow = Ti.UI.createPickerRow( { title : choices[i] }); pickerData.push(thisPickerRow); } var picker = Ti.UI.createPicker( { // selectionIndicator : true, choices : pickerData, questionNo:j }); var row2 = Ti.UI.createTableViewRow( { height: 100 }); picker.add(pickerData); row2.add(picker); tvData.push(row2); picker.addEventListener('change',function(e) { Ti.API.info("On question "+e.source.questionNo+", "+" you changed to answer "+e.row); }); } detailTableView.setData(tvData); win1.open();
Good luck with it! :)
-
Did you have any luck with this code, Aaron? If I missed the point, and it isn't quite what you wanted, explain the details and I'll see what needs to be changed.
-
Aaron
I noticed you asked a question about raising tickets in this post. I think it's answered in the Contribute to Titanium guide, which is quite new so you probably have not seen it.
Please excuse the off-topic post - the original post had been closed by the time I noticed your question.
Cheers