KorryRogers
Posts: 0
Joined: Fri Aug 15, 2014 2:53 am

Show Select Box After Successful JSON Service Call

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!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Show Select Box After Successful JSON Service Call

Hello Korry,

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

KorryRogers
Posts: 0
Joined: Fri Aug 15, 2014 2:53 am

Show Select Box After Successful JSON Service Call

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.

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

Show Select Box After Successful JSON Service Call

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.

Return to “Issues”