Page 1 of 2

Making a List item invisible?

Posted: Sun Jul 05, 2015 4:13 am
by A.W.H.

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


Making a List item invisible?

Posted: Sun Jul 05, 2015 2:50 pm
by Evgene Karachevtsev

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


Making a List item invisible?

Posted: Mon Jul 06, 2015 2:58 am
by A.W.H.

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.


Making a List item invisible?

Posted: Tue Jul 07, 2015 1:06 am
by A.W.H.

Hello?


Making a List item invisible?

Posted: Wed Jul 08, 2015 12:13 pm
by Pavel Zarudniy

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


Making a List item invisible?

Posted: Sun Jul 12, 2015 12:35 am
by A.W.H.

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/


Making a List item invisible?

Posted: Sun Jul 12, 2015 3:00 am
by Alena Prykhodko

Avery,

Have you replaced with your List component name?


Making a List item invisible?

Posted: Sun Jul 12, 2015 3:07 am
by A.W.H.

Component name or List name?


Making a List item invisible?

Posted: Sun Jul 12, 2015 3:10 am
by A.W.H.

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...


Making a List item invisible?

Posted: Sun Jul 12, 2015 3:18 am
by A.W.H.

Please see my next comment