
var win = Titanium.UI.createWindow({
        backgroundColor: 'white'
    });
    
    
    // data for tableview
    var data = [
    
        {title:'Alege client', color:'black', font:{fontSize:16,fontWeight:'bold'}, leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_playmovie.png'},
                 //leftImage: '/images/tableview/phone_playmovie.png'},//
    
        {title:'Camera', hasChild: true, color:'black', font:{fontSize:16,fontWeight:'bold'},
                 leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_camera.png'},
    
        {title:'Vibrate',hasCheck: true, color:'black', font:{fontSize:16,fontWeight:'bold'},
                 leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_vibrate.png'},
    
        {title:'Orientation',color:'black', font:{fontSize:16,fontWeight:'bold'},
            leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_orientation.png'},
    
        {title:'Photo Gallery',color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_photogallery.png'},
    
        {title:'Geo Location',color:'black', font:{fontSize:16,fontWeight:'bold'},
                 leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_geoloc.png'},
    
        {title:'Accelerometer', color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_accelerometer.png'},
    
        {title:'Sound', color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_sound.png'},
    
        {title:'Shake', color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_shake.png'},
    
        {title:'Email Client',color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_email.png'},
    
        {title:'Save to Gallery',color:'black', font:{fontSize:16,fontWeight:'bold'},
                leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_savetogallery.png'},
    
        {title:'Contacts',color:'black', font:{fontSize:16,fontWeight:'bold'},
                 leftImage: 'https://raw.github.com/andi2/KitchenSink/master/Resources/images/tableview/phone_contact.png'}
    ];
    
var newData=[];

for (rowIndex = 0 , rowLength = data.length; rowIndex < rowLength; rowIndex+=1){
      
    var row = Ti.UI.createTableViewRow({
       height:'40dp',
       hasChild:true,
       className: 'test'
    });
 
    var nameLabel = Ti.UI.createLabel({
        text: data[rowIndex].title,
        color:'black', 
        font:{
            fontSize:16,fontWeight:'bold'
        },
        //top:8,
        left:48,
        width:'auto',
        //height:16,
        textAlign:'left'
    });
    row.add(nameLabel);
 
    var imageView = Ti.UI.createImageView({
        image:data[rowIndex].leftImage,
        //top:0,
        left:0,
        width:'auto',
        height:'auto',
        preventDefaultImage:true
    });
     
    row.add(imageView);
    newData.push(row);
}

    
    // tableview object
    var tableView = Titanium.UI.createTableView({
        //backgroundColor:'transparent',
        data:newData,
        top:10
    });
    if (Ti.Platform.osname !== 'mobileweb') {
        tableView.separatorStyle = Ti.UI.iPhone.TableViewSeparatorStyle.NONE;
    }
    
    var wrapperView = Titanium.UI.createView({backgroundColor:'transparent',width:'auto'});
    
    wrapperView.add(tableView);
    win.add(wrapperView);
    
win.open();
