Page 1 of 1

Hide Button in List Item

Posted: Fri Nov 04, 2016 12:20 pm
by Deon

Hi
I have a button (pair) on a list item. I want it to be hidden based on the value of the label called cat on the same list item but it only hides the button on the first list item. All buttons on the rest of the list items should also be hidden because their value is not 16, but the button is not hidden.

This is my js for the "cat" label in the mapping.

if (value !== 16) {
Appery('mobilebutton_118').hide();
}
return value;

Image
Image
Image


Hide Button in List Item

Posted: Fri Nov 04, 2016 3:12 pm
by Serhii Kulibaba

Hello Deon,

Please use JS below:pre$(this).closest("table").find("[name=mobilebutton_118]").hide(); /pre instead of:
preAppery("mobilebutton_118").hide(); /pre


Hide Button in List Item

Posted: Mon Nov 07, 2016 12:03 pm
by Deon

Nope. Still only does it to the 1st list item.


Hide Button in List Item

Posted: Tue Nov 08, 2016 10:31 am
by Serhii Kulibaba

Please set a custom class to that button, and use it in the JS code, e.g.:

pre$(this).closest("table").find(".myClass").hide(); /pre


Hide Button in List Item

Posted: Thu Nov 10, 2016 5:26 am
by Deon

I dont understand. What would the class code consist of? Nothing???


Hide Button in List Item

Posted: Thu Nov 10, 2016 12:52 pm
by Serhii Kulibaba

Yes, you can use a class only in the JS code, without any CSS