A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

For each item in the list, when the split button clicked, make that item in the list invisible.

I don't want to delete it from the database. I just wanted it to no longer show up for that user, after they click the button. How do I set these properties for every item in a list (Drawn from database)? What logic will I have to implement?

Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Making a List item invisible?

Hello Avery,

You can call JS code on desired event and use the following code to make the element you want invisible
preApperyio("componentName").hide();/pre

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

That will only hide the first component of the list. Since there is a variable number of items in the list, I need the code to work for all of the components in the list.

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

Hello?

Pavel Zarudniy
Posts: 0
Joined: Mon Jul 06, 2015 8:56 am

Making a List item invisible?

Hello Avery,
You can use this code:
codeApperyio("<list_name>")&#46;children()&#46;each(
function(){
$(this)&#46;click(function(){ $(this)&#46;hide();});
}
);/code
for example, this code may executing when page is loaded

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

Pavel,

I just created an action from 'Click' on the list button to 'Run javascript', and clicking the list button to submit the task does successfully send the task to the DB, but doesn't hide the list item successfully.

Help/

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Making a List item invisible?

Avery,

Have you replaced with your List component name?

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

Component name or List name?

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

Apperyio("employeesList").children().each(
function(){
$(this).click(function(){ $(this).hide();});
}
);

This is called upon mobileitemlistbutton click, but upon clicking that button I have to click somewhere on the list to actually hide the list component.

After one list component is hidden, if I try to hide another one, I can do so by clicking anywhere on that list component -- this is not what I want, instead I want to be able to hide the list component by clicking on the lsititembutton (-- shape) to 'send' the message and remove it from the page.

Here's a link to the public app, navigate to the "Compose" page, and try clicking the right-hand side mobileitemlistbutton (the - button on each list item component).

http://appery.io/app/view/759808b6-f3...

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

Making a List item invisible?

Please see my next comment

Return to “Issues”