Page 1 of 2

refresh list after deleting an item

Posted: Wed May 14, 2014 10:40 pm
by Anthony Hyams

I have a list. There is a split button on the right. when I click this button it invokes a service that deletes the item from the database. This all works. However when I try to refresh the list on the delete item success using the following

Appery('mobilelist_1').listview("refresh");

Nothing happens. The item is deleted but list remains how it is. If I navigate away and back again then the list refreshes as I would expect.


refresh list after deleting an item

Posted: Wed May 14, 2014 11:13 pm
by Illya Stepanov

Hi Anthony -

Where exactly you put this code?


refresh list after deleting an item

Posted: Wed May 14, 2014 11:38 pm
by Anthony Hyams

there is a delete service that runs when the button is clicked. I run it as a javascript event on the success of the delete service


refresh list after deleting an item

Posted: Thu May 15, 2014 9:38 am
by Kateryna Grynko

Hi Anthony,

How do you delete a list item?


refresh list after deleting an item

Posted: Thu May 15, 2014 10:27 am
by Paul Ladley

I had this problem. I solved it by calling the list service again on a success event after the deletion (or in my case addition).

I can't get the deletion to work though. I have tried labels on lists, but that makes them not clickable. What do you mean by split button - a checkbox? I have just put a label on a checkbox and they remain clickable, so might try that.


refresh list after deleting an item

Posted: Thu May 15, 2014 10:36 am
by Paul Ladley

Sorry for spamming - I have just found the split button option. I am newbie - oops!

Mind you as soon as i drag a label or grid on to the split button it stops being clickable. No hover state, and the cursor doesn't change except for becoming a caret over the label text.


refresh list after deleting an item

Posted: Thu May 15, 2014 11:11 am
by Kateryna Grynko

Hi Paul,

Let us know if you need any further help.


refresh list after deleting an item

Posted: Thu May 15, 2014 11:17 am
by Paul Ladley

Yes I do, but maybe we should do it in my original post, so as not to hijack Anthony's post any further

https://getsatisfaction.com/apperyio/...


refresh list after deleting an item

Posted: Thu May 15, 2014 11:22 am
by Anthony Hyams

Paul, just to say - When I wanted to map several data items to a list I discovered the same issue. The trick was to build what I wanted on the list in javascript and then return it to the list

eg. return " Event:" + value.event_name + " Event starts

" + value.start_time + "

";

this worked for me


refresh list after deleting an item

Posted: Thu May 15, 2014 11:26 am
by Kateryna Grynko

Paul,

Let's continue there. Let us know if Anthony's solution helps.