Month: February 2015

Titanium tableView rowData id missing in android but working in iOS

I found a strange problem while coding in Titanium

I first tested my code on iOS only and not on android. Now in one of the table I redesigned the rows with height etc.

Now I was accessing the onClick event, but in the value was missing. I don’t know why.

So I used the following code to get the access of ID and so that it works on both android as well as iOS

	console.log('**********MY EXPERIMENT ***********');
	for (var i = 0; i < dataArray.length; ++i) {
		console.log('IN FOR LOOP' + i);
		var row = Titanium.UI.createTableViewRow();
		//row.layout = 'vertical'; = dataArray[i].id;
		row.backgroundColor = '#000000';

		var e_code = Titanium.UI.createLabel({
			text : dataArray[i].display_panel_code,
			font : {
				fontSize : '24dp',
				fontWeight : 'bold',
				fontFamily : 'Digital-7'
			color : "#00FF04",
			//width : '30%',
			textAlign : 'left',
			left : '20dp'


		led_code = dataArray[i].led_code;
		console.log('**********LED CODE : ' + led_code);
		if (led_code != null || led_code != '') {
			ledImages = createLedImage(led_code);
			ledImages.left = '120dp';

		var e_summary = Titanium.UI.createLabel({
			text : dataArray[i].summary,
			font : {
				fontSize : '14dp',
			color : "#FFFFFF",
			//width : '70%',
			textAlign : 'left',
			left : '20dp',
			height : 'auto',
			top : '40dp'

		row['errorcode_id']=dataArray[i].id;///added to support the android applications and ios both

		//row.className = 'e_code_row';

	}///end of for

and to accesss it I used


Titanium Cross Platform Mobile Development


I am writing this blog along with my learning. Yesterday I started learning about Titanium and writing this blog on the fly. My idea is to cover all basic problems newbie come across and how to learn them

Some Common Commands

console.log(‘***CONSPLE LOG**************’);‘******************’);