zoukankan      html  css  js  c++  java
  • titanium开发教程0409删除rows

    12

    // this sets the background color of the master UIView (when there are no windows/tab groups on it)
    Titanium.UI.setBackgroundColor('#000');
    
    // create tab group
    var tabGroup = Titanium.UI.createTabGroup();
    
    var win = Titanium.UI.createWindow({  
        title:"Main Window",
        backgroundColor:"#FFFFFF",
        //navBarHidden:true, //Hide the nav bar for the window
        tabBarHidden:true //Hide the tab bar for the window
    });
    var tab = Titanium.UI.createTab({  
        icon:"KS_nav_views.png",
        title:"Main Tab",
        window:win
    });
    
    var data = [
    	{title:"Backpack Cal", leftImage:"images/01-backpack-cal-thumb.png", className:"tableRow", hasCheck:true},
    	{title:"California Calm", leftImage:"images/02-calm-cal-thumb.png", className:"tableRow", hasDetail:true},
    	{title:"California Hotsprings", leftImage:"images/03-hotsprings-cal-thumb.png", className:"tableRow", hasChild:true},
    	{title:"Cycle California", leftImage:"images/04-cycle-cal-thumb.png", className:"tableRow"},
    	{title:"From Desert to Sea", leftImage:"images/05-desert-cal-thumb.png", className:"tableRow"},
    	{title:"Kids California", leftImage:"images/06-kids-cal-thumb.png", className:"tableRow"},
    	{title:"Nature Watch", leftImage:"images/07-nature-watch-cal-thumb.png", className:"tableRow"},
    	{title:"Snowboard Cali", leftImage:"images/08-snowboard-cal-thumb.png", className:"tableRow"},
    	{title:"Taste of California", leftImage:"images/09-taste-cal-thumb.png", className:"tableRow"}
    ]
    
    var tableView = Titanium.UI.createTableView({
    	data:data,
    	editable:true,
    	allowsSelectionDuringEditing:true
    	
    });
    
    //Tap a row to delete it
    tableView.addEventListener("click",function(e){
    	//Switch between the editing and non-editing mode
    	/*
    	if(!tableView.editing){
    		tableView.editing = true;
    	}else{
    		tableView.editing = false;
    	}
    	*/
    	//Android: use deleteRow
    	tableView.deleteRow(e.index);
    })
    
    //Restore the row; exit editing mode
    tableView.addEventListener("delete",function(e){
    	tableView.editing = false;
    })
    
    win.add(tableView);
    
    tabGroup.addTab(tab);  
    
    // open tab group
    tabGroup.open();
  • 相关阅读:
    WCF配置文件注释
    WCF 契约
    等待窗口 or splash 窗体用法
    SOA架构概述
    在高负载网站性能优化
    WCF应用实例
    SOA快速指南 1 2 3,第 3 部分: 服务实现及架构设计
    WCF Binding
    已经添加了对EXCEL的引用,但在出现Microsoft.Office.Interop.Excel.Application没有定义
    Oracle 11g 转换内部编码
  • 原文地址:https://www.cnblogs.com/xiaozhanga4/p/2403313.html
Copyright © 2011-2022 走看看