emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

I am making a todo app with delete service and instead of clicking a certain item in the list to delete it i want to a click a button that will delete every single item currently in the list.What should i do and is there a certain JS i need? thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Question With Deleting in Todo App

Hi Emma,

If I understand you correctly, you should save object IDs in an array: http://docs.appery.io/documentation/r...
Then on listitem click event delete a Database record by array index.

emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

i am confused on what you mean by save object IDs in an array...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Question With Deleting in Todo App

Hello! You have to invoke Delete service as many times as many records you need to delete, every time you delete record with a specific _id. Here is more information http://docs.appery.io/documentation/b... (see Deleting Objects section). The way you retrieve all these records _id depends on your app logic and page structure. Please try and contact us in case you have specific question.

emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

I changed my app to now just follow the simple todo app step for deleting and i can't not fin my mistake...
i have tested my delete service and it works
here are some pictures:

Image

Image

Image

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Question With Deleting in Todo App

Hi Emma,

When you multiple components using a service (as listitem) names will also be duplicated. So to write taskId variable run this JS on listItem click:prevar taskId = $(this).find("[name=taskId]").text();
localStorage.setItem("taskId", taskId );/pre

emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

i just tried this java on listitem clink run java script, shown below, but it will still not delete any item from the list

Image

it this the right order...?

Image

emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

i also just tested switching the 2 and 3 actions of the mobilelistitem but that did not work either

emma HASKELL
Posts: 0
Joined: Thu Jan 02, 2014 3:42 pm

Question With Deleting in Todo App

i am actually all set thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Question With Deleting in Todo App

Emma,

Glad it's done. Thank you for the update!

Return to “Issues”