Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Hiding list items

I am using this js to hide and show list items based on values within them

var list=Appery("listPreviousInvoices");

if($(this).text()=='Hide'){
$(this).text("Show");
list.find("[name=mobilegridcell_255]:contains(Paid)").parent().hide();

}
else
{ $(this).text("Hide");
list.find("[name=mobilegridcell_255]:contains(Paid)").parent().show();

}

Its sort of working but leaves a blank area as can be seen in the screenshot. How do I hide this part of the list item also?

Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Hiding list items

Hello Aeneas,

You should hide "tr" tag for hiding full line. When you hide "grid cell" or "td" tags, "tr" it still shows.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Hiding list items

So how should I change the code to hide tr tag?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Hiding list items

Change
list.find("[name=mobilegridcell_255]:contains(Paid)").parent().hide();
to
list.find("[name=mobilegridcell_255]:contains(Paid)").closest('tr').hide();

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Hiding list items

Hi Sergiy,

Changing to you code has the same result. The issue is the div at the end of the list item called ui_li_static_container is still showing even though the list item or tr that its in has been hidden.

You can see this in my screenshot.

Thanks,
Aeneas

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Hiding list items

Please provide us with a public app link (http://devcenter.appery.io/documentat...) and steps to reproduce.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Hiding list items

Hi, my app is shared with support already.

http://appery.io/app/view/8e12fcf4-2b...

Please logon with bob/bob and got to invoice screen. Then select red and green hid/show button at top to demonstrate issue.

Thanks,
Aeneas

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Hiding list items

You should also hide wrappers for all items:

So use:
prelist.find("[name=mobilegridcell_255]:not(:contains(Paid))").closest('[name=listPreviousInvoicesItem]').hide();/pre

instead of:
prelist.find("[name=mobilegridcell_255]:not(:contains(Paid))").closest('tr').hide();/pre

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Hiding list items

Works great, thanks!

Return to “Issues”