Created
May 21, 2012 06:08
-
-
Save KarthiPnsmy/2760705 to your computer and use it in GitHub Desktop.
hide table row header in Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.CourseList = function(page_title){ | |
var platform = Ti.Platform.osname; | |
var courseDetail = require('ui/CourseDetailWindow'); | |
var config = require('config/config'); | |
var win = Ti.UI.createWindow({backgroundColor:'#000'}); | |
// create table view data object | |
var params = [ | |
{title:'Alan', color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'A'}, | |
{title:'Alice', color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Alexander',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Amos',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Alonzo',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Brad',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'B'}, | |
{title:'Brent',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Billy',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Brenda',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Callie',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'C'}, | |
{title:'Cassie',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Chris',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Cameron',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Don',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'D'}, | |
{title:'Dilbert',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Deacon',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Devin',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Darin',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Darcy',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Erin',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'E'}, | |
{title:'Erica',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Elvin',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Edrick',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Frank',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'F'}, | |
{title:'Fred',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Fran',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Felicity',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'George',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}, header:'G'}, | |
{title:'Gina',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}}, | |
{title:'Gary',color:'#000',font:{fontSize:17,fontWeight:'bold',fontFamily:'Helvetica Neue'}} | |
]; | |
var searchBar = Titanium.UI.createSearchBar({ | |
showCancel:true, | |
barColor:'#5195D6', | |
backgroundImage:'../images/row_bg.png' | |
}); | |
// create table view | |
var tableview = Titanium.UI.createTableView({ | |
top:43, | |
data:params, | |
search:searchBar, | |
filterAttribute:'title', | |
backgroundColor:'#fff' | |
}); | |
// create table view event listener | |
tableview.addEventListener('click', function(e) | |
{ | |
if (platform === 'android') { | |
searchBar.value =""; | |
searchBar.hide(); | |
searchBar.show(); | |
} | |
if(e.rowData.title){ | |
var window = courseDetail.CourseDetailWindow(e.rowData.title); | |
if (platform == "iphone") { | |
Titanium.UI.currentTab.open(window,{animated:true}); | |
}else{ | |
window.open(); | |
} | |
} | |
}); | |
searchBar.addEventListener('cancel', function (e) { | |
if (platform === 'android') { | |
searchBar.value =""; | |
searchBar.hide(); | |
searchBar.show(); | |
} | |
}); | |
win.add(tableview); | |
return win; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment