Bu *_*Ali 2 listview titanium appcelerator titanium-mobile
我想在列表视图中删除一行.当用户单击一行时,我想打开一个对话框,显示"确定要删除"的消息.当用户单击"确定"时,应删除"行".
listView.addEventListener('itemclick', function(e){
var section = e.section;
var itenIndex = e.itemIndex;
var dialog = Ti.UI.createAlertDialog({
title : 'Do you want to delete the row?',
buttonNames : ['Yes','No']
});
dialog.addEventListener('click', function(e){
if(e.index == 0){
section.deleteItemsAt(itenIndex,1);
}
});
dialog.show();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2004 次 |
| 最近记录: |