Issue regarding the change event of textfield in titanium

…衆ロ難τιáo~ 提交于 2019-12-06 12:23:09

Try this:

var newTF = [];
    for (var i = 0; i < 3; i++) {
        newTF[i] = Ti.UI.createTextField({
            //top : 20,
            hintText : "new text field under " + (i + 1) + " text field",
            width : '100%',
            id :i+1,
        });
        //newTF[i].addEventListener('');
        newTF[i].addEventListener('change', function(e) {
            Ti.API.info('e is'+JSON.stringify(e));
         if (e.source.getValue == 'entered value') {
                // //do something
         } else {
                // //do something
         }
        });
        $.laynout.add(newTF[i]);
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!