Skip to content

Instantly share code, notes, and snippets.

@Amimul100
Created August 13, 2014 09:17
Show Gist options
  • Save Amimul100/9fd2f5bb95aad908570a to your computer and use it in GitHub Desktop.
Save Amimul100/9fd2f5bb95aad908570a to your computer and use it in GitHub Desktop.
TextField In TableViewRow
Hello, I have tested this Problem and it's working
TESTING ENVIRONMENT
CLI version 3.3.0,
Titanium SDK version 3.3.0.GA
Mac OS
CODE SEGMENT
{Code:app.js}
var tableData = [];
var win = Ti.UI.createWindow({ backgroundColor: 'white' });
var table = Ti.UI.createTableView({ objName: 'table' });
for (var i = 0; i <= 20; i++){
var row = Ti.UI.createTableViewRow({
className: 'row',
objName: 'row',
touchEnabled: true,
height: 100
});
var enabledWrapperView = Ti.UI.createView({
backgroundColor:'#008FD5',
objName: 'enabledWrapperView',
rowID: i,
width: Ti.UI.FILL, height: '100%'
});
var textField = Ti.UI.createTextField({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color: '#336699',
top: 10, right: 10,
width: 400, height: 60
});
enabledWrapperView.add(textField);
var label = Ti.UI.createLabel({
backgroundColor:'#313F48',
color: 'white',
objName: 'label',
text: "Textfield "+ i,
touchEnabled: false,
left: 0,
width: 200
});
enabledWrapperView.add(label);
row.add(enabledWrapperView);
tableData.push(row);
}
table.setData(tableData);
table.addEventListener('swipe', function(e){
if (e.source && e.source.objName !== 'table'){
Ti.API.info('Row swiped: ' + e.source);
Ti.API.info('Row swiped: ' + e.source.objName);
Ti.API.info('Row ID : ' + e.source.rowID);
}
});
win.add(table);
win.open();
{code}
STEP TO TEST
* Create a new Project
* Copy the Code to your Project "app.js" file
* Run the Project
Thanks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment