Page 1 of 1

Reset cascading SELECT menu dropdown boxes

Posted: Wed Apr 24, 2013 2:17 pm
by Dan Gagliardi

I have 3 SELECT menus, all populated from 3 different Collections.

S1 - S2 - S3

First time through the interface, S1 is populated, S2, S3 are not. choose S2, S3 gets populated.

Go back and Choose a new option form S1, S2 refreshes with new set, but S3 still has list of options from the first selection of S2. How can I reset both S3 when I choose a new option in S1.

Thanks
D


Reset cascading SELECT menu dropdown boxes

Posted: Wed Apr 24, 2013 3:49 pm
by maxkatz

It's can be done with JavaScript. Here is a starting point: http://docs.appery.io/tutorials/build...


Reset cascading SELECT menu dropdown boxes

Posted: Wed Apr 24, 2013 4:39 pm
by Kateryna Grynko

Hi Dan,

Just to add. To clean Select Menu component use "Run Javascript" action with the following code: codeAppery('selectMenuComponent').empty().selectmenu('refresh');/code Replace 'selectMenuComponent' with the component name.


Reset cascading SELECT menu dropdown boxes

Posted: Wed Apr 24, 2013 5:07 pm
by Dan Gagliardi

for some reason, using the empty() method removes all entries and then the REST service can't properly populate the select box. I think I would need to empty() then add a no value option, then refresh.

Thanks for the help!


Reset cascading SELECT menu dropdown boxes

Posted: Wed Apr 24, 2013 5:17 pm
by Kateryna Grynko

Let us know about the result.