Page 1 of 1

Show Select Box After Successful JSON Service Call

Posted: Fri Aug 15, 2014 1:23 pm
by KorryRogers

I've got a select box on my page named selectRegion2. By default, it his not visible. The data for this box is loaded via a JSON call. I pass a variable into the call and if there are no results, the page returns a 403 error so the call isn't successful. When there is data, the call is successful and the select options are loaded correctly, but I can't seem to get the select box to show up after a successful call. Right now I have the following JS that runs on service success.

Appery("selectRegion2").val(localStorage.region2Id);
Appery("selectRegion2").selectmenu('refresh');
Appery("selectRegion2").show();

Why will the select box not show?

Thanks!


Show Select Box After Successful JSON Service Call

Posted: Fri Aug 15, 2014 1:38 pm
by Evgene Karachevtsev

Hello Korry,

Could you please check, are there errors in browser's console?


Show Select Box After Successful JSON Service Call

Posted: Sat Aug 16, 2014 2:50 pm
by KorryRogers

There are no error. I found a work around by adding another action to the success of the service that changes the visible property on that select box. I'm still curious as to why the .show() didn't work though.


Show Select Box After Successful JSON Service Call

Posted: Mon Aug 18, 2014 11:39 pm
by Yurii Orishchuk

Hi Korry,

Please use following JS code to show select(hided by "visible" checkbox in Appery.io editor).

pre

//Note you need to replace "mobileselectmenu_2" with your select component name.
Appery("mobileselectmenu_2").closest('[data-role="fieldcontain"]').show();

/pre

Regards.