Page 1 of 2
Showing/hiding single item in a static mobile list
Posted: Wed Jun 18, 2014 10:37 pm
by RobertJay
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();
Showing/hiding single item in a static mobile list
Posted: Thu Jun 19, 2014 2:42 am
by Yurii Orishchuk
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.
Showing/hiding single item in a static mobile list
Posted: Thu Jun 19, 2014 3:08 pm
by RobertJay
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.
Showing/hiding single item in a static mobile list
Posted: Fri Jun 20, 2014 12:56 am
by Yurii Orishchuk
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.
Showing/hiding single item in a static mobile list
Posted: Fri Jun 20, 2014 2:03 pm
by RobertJay
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.
Showing/hiding single item in a static mobile list
Posted: Fri Jun 20, 2014 8:43 pm
by Kateryna Grynko
Hi Robert,
Use the following code to hide a list item:preApperyio("mobilelist_3").hide();/pre
Showing/hiding single item in a static mobile list
Posted: Fri Jun 20, 2014 8:54 pm
by RobertJay
That's perfect Katya, thanks. What would I use to make it visible - I tried show(), unhide(), and visible() without success.
Showing/hiding single item in a static mobile list
Posted: Sat Jun 21, 2014 4:01 am
by Alena Prykhodko
Robert,
preApperyio("mobilelist_3").show();/pre works for me, on what event do you fire it?
Do you have any error in console (F12)?
Showing/hiding single item in a static mobile list
Posted: Sat Jun 21, 2014 1:31 pm
by RobertJay
Hi... in the page show event. No console errors display.
Showing/hiding single item in a static mobile list
Posted: Sat Jun 21, 2014 1:58 pm
by Illya Stepanov
Hi Robert,
Sorry, it's not clear what is a desirable result that you want. Please describe the use case you want to implement.