Pregunta

I want to delete a row in list view. When user clicks a row I want to open a Dialog showing the message that 'sure you want to delete'. When user clicks ok then the Row should be deleted.

¿Fue útil?

Solución

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();
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top