RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Showing/hiding single item in a static mobile list

I've got a static mobile list ("list") with 5 items. The second item ("item2") needs to be visible or not visible via JS, but I'm not sure how to do it. The following seems not to be the way. Thank you very much.

Appery('Item2').show();
Appery('Item2').hide();

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Showing/hiding single item in a static mobile list

Hi Robert.

You can use following code:

pre

//Note you should replace "mobilecheckboxgroup_25" with your list component name.
var yourListComponentName = "mobilecheckboxgroup_25";

var itemNumber = 2;

var item = Apperyio(yourListComponentName).find(".ui-controlgroup-controls span:eq(" + (itemNumber - 1) + ")");

//Code to hide item.
item.hide();

//Code to show item.
item.show();

/pre

Regards.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Showing/hiding single item in a static mobile list

Thank you Yurii - but it does not work. I've also tried without success the following from https://c.getsatisfaction.com/apperyi...:

Appery('mobilelist_3').closest("manage_messages").unhide();

Am I missing something? If you can get the above working, that would be a better solution for my general needs in the future. Thanks again.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Showing/hiding single item in a static mobile list

Hi Robert,

I've gave you worked and tested solution.

So please try given solution again and if you still have a problem please give us your app public link and describe steps to reproduce the problem.

Thanks & regards.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Showing/hiding single item in a static mobile list

Thank you Yurii. App is shared and is named BlockFacts. Simply click the log-in button. The page which opens has your code in the page show event, but does not hide item 3.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Showing/hiding single item in a static mobile list

Hi Robert,

Use the following code to hide a list item:preApperyio("mobilelist_3").hide();/pre

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Showing/hiding single item in a static mobile list

That's perfect Katya, thanks. What would I use to make it visible - I tried show(), unhide(), and visible() without success.

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

Showing/hiding single item in a static mobile list

Robert,

preApperyio("mobilelist_3").show();/pre works for me, on what event do you fire it?
Do you have any error in console (F12)?

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Showing/hiding single item in a static mobile list

Hi... in the page show event. No console errors display.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Showing/hiding single item in a static mobile list

Hi Robert,

Sorry, it's not clear what is a desirable result that you want. Please describe the use case you want to implement.

Return to “Issues”