Question

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.

Était-ce utile?

La solution

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();
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top