Javascript Appcelerator TableView>;世界其他地区>;TextField>;价值

Javascript Appcelerator TableView>;世界其他地区>;TextField>;价值,javascript,android,tableview,textfield,appcelerator,Javascript,Android,Tableview,Textfield,Appcelerator,我正在制作一个每行都有一些文本字段的tableview,但问题是我不知道如何访问它们的值 这是我的代码: function TextFieldValueWindow(title, value1,value2) { var self = Ti.UI.createWindow({ backgroundImage:'/images/backgrounds/BG_table_view.jpg', fullscreen :false, navBarHidden:true });

我正在制作一个每行都有一些文本字段的tableview,但问题是我不知道如何访问它们的值

这是我的代码:

function TextFieldValueWindow(title, value1,value2) {
var self = Ti.UI.createWindow({
    backgroundImage:'/images/backgrounds/BG_table_view.jpg',
    fullscreen :false,
    navBarHidden:true
});

var my_navbar = Ti.UI.createLabel({
    height:'25dp',
    font:{fontFamily:'Arial',fontWeight:'bold',fontSize:'14dp'},
    backgroundColor:'#2451A1',
    width:'100%',
    color:'#fff',
    textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
    text:title,
    top:0
});

var data = [];

var xhr = Ti.Network.createHTTPClient();
xhr.timeout = 1000000;
xhr.open("GET","http://xxxx.com/xxx?m="+value1+"");

xhr.onload = function() {

    try {
        var students = JSON.parse(this.responseText);

        for (var c=0;c<students.length;c++){
            var id = students[c].id;
            var name = students[c].name;
            var lastName = students[c].lastName;

            var row = Ti.UI.createTableViewRow({height:'280dp',height:'30dp',RowStudentID:id,backgroundColor: 'transparent'});

            var name_label = Ti.UI.createLabel({
                text:name,
                left:'10dp',
                width:'120dp',
                top:'5dp',
                bottom:'2dp',
                height:'18dp',
                textAlign:'left',
                color:'white',
                font:{fontFamily:'Trebuchet MS',fontSize:14,fontWeight:'bold'}
            });

            var lastname_label = Ti.UI.createLabel({
                text:lastName,
                left:'10dp',
                width:'120dp',
                top:'25dp',
                bottom:'2dp',
                height:'18dp',
                textAlign:'left',
                color:'white',
                font:{fontFamily:'Trebuchet MS',fontSize:14,fontWeight:'bold'}
            });

            var textfieldinput =    Titanium.UI.createTextField({
                width:'50dp',
                right:'5dp',
                top:'10dp',
                height:'40dp',
                value:'',
                keyboardType:Ti.UI.KEYBOARD_NUMBER_PAD,
                //borderStyle:Titanium.UI.INPUT_BORDERSTYLE_NONE
            });

            row.add(lastname_label);
            row.add(name_label);    
            row.add(textfieldinput);

            row.className = 'item'+c;
            data[c] = row;
        }


        var tableview = Titanium.UI.createTableView({
            data:data,
            top:'25dp',
            height:'370dp',
            backgroundColor: 'transparent',
            minRowHeight:'50dp'
        });

        self.add(my_navbar);
        self.add(tableview); 

    }catch(E){
        alert(E);
    }

    var notasBtn = Titanium.UI.createButton({
        title:'btn',
        width:'140dp',
        height:'40dp',
        borderRadius:'2dp',
        bottom:'10dp',
        verticalAlign:'center',
        font:{fontFamily:'Arial',fontWeight:'bold',fontSize:'14dp'}
    });
    self.add(notasBtn);

    notasBtn.addEventListener('click', function(e){ 

        var dataNotas=[];
        var _rowData = tableview.data[0].rows;
        for ( var x in _rowData) {
             Ti.API.info(??); 
        }
    });
};

self.addEventListener('open', function() {
    xhr.send();
});

return self;
函数文本字段值窗口(标题、值1、值2){
var self=Ti.UI.createWindow({
背景图片:'/images/backgrounds/BG_table_view.jpg',
全屏:假,
navBarHidden:真的
});
var my_navbar=Ti.UI.createLabel({
高度:'25dp',
字体:{fontFamily:'Arial',fontWeight:'bold',fontSize:'14dp'},
背景颜色:“#2451A1”,
宽度:'100%',
颜色:“#fff”,
TEXT对齐:Ti.UI.TEXT\u对齐\u中心,
正文:标题,
排名:0
});
var数据=[];
var xhr=Ti.Network.createHTTPClient();
xhr.timeout=1000000;
xhr.open(“GET”http://xxxx.com/xxx?m=“+value1+”);
xhr.onload=函数(){
试一试{
var students=JSON.parse(this.responseText);

对于(var c=0;c),还可以将子标签设置为行的属性

    var row = Ti.UI.createTableViewRow({...});
        row.name = Ti.UI.createLabel({...});
        row.lastName = Ti.UI.createLabel({...});
        row.textField = Ti.UI.createTextField({...});

        row.add(row.name);
        row.add(row.lastName);    
        row.add(row.textField);
然后可以将其作为行属性访问:

notasBtn.addEventListener('click', function(e){ 
    var dataNotas=[];
    var _rowData = tableview.data[0].rows;
    for ( var x in _rowData) {
         Ti.API.info(_rowdata.textField.value); 
    }
});