Page 1 of 1

Question With Deleting in Todo App

Posted: Thu Jan 02, 2014 3:45 pm
by emma HASKELL

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


Question With Deleting in Todo App

Posted: Thu Jan 02, 2014 4:48 pm
by Kateryna Grynko

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.


Question With Deleting in Todo App

Posted: Mon Jan 06, 2014 3:31 pm
by emma HASKELL

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


Question With Deleting in Todo App

Posted: Mon Jan 06, 2014 8:49 pm
by Maryna Brodina

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.


Question With Deleting in Todo App

Posted: Tue Jan 07, 2014 3:44 pm
by emma HASKELL

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


Question With Deleting in Todo App

Posted: Wed Jan 08, 2014 8:08 am
by Kateryna Grynko

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


Question With Deleting in Todo App

Posted: Wed Jan 08, 2014 2:36 pm
by emma HASKELL

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


Question With Deleting in Todo App

Posted: Wed Jan 08, 2014 2:45 pm
by emma HASKELL

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


Question With Deleting in Todo App

Posted: Wed Jan 08, 2014 3:08 pm
by emma HASKELL

i am actually all set thanks


Question With Deleting in Todo App

Posted: Wed Jan 08, 2014 3:12 pm
by Kateryna Grynko

Emma,

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