Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

deleting table view rows

$
0
0

Hi all, i'm currently working on an iOS table, but will have to implement same in Android after (I realise I will need a different approach the 'editing' property is iOS only).

I have an edit button, which when clicks make my table editable. What I need to do is be able to grab the index of the row which was deleted, I haven't seen any examples of this. I need the index, because I need to implement a web service which deletes a database entry based on the index of the row. I am using a delete event listener on the tableview as I think this would be the starting point?? Code so far:

var Edit_img=Ti.UI.createImageView({
        image:'/images/edit.png',
        top: '5dp',
        left: '5dp',
        width: '30dp',
        heighht: '30dp',
        bottom:'5dp',
        visible:false
    });
 
Edit_img.addEventListener("click", function(e){
    Navbar.add(Done_btn);
    Navbar.remove(Edit_img);
    MyJobs_table.setEditing(true);
});
 
MyJobs_table.addEventListener("delete", function (e){
    alert("I need the index deleted here");
});
Also if there are any issues which may arise relating to indexes after deleting rows, please let me know! Any help appreciated, thanks

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>