[dancer-users] how to change drop down list on different tabs

Wanjuan Yang wy1 at sanger.ac.uk
Wed Mar 23 10:49:02 GMT 2016






On 3/22/16, 9:34 PM, "dancer-users on behalf of Chad Wallace" <dancer-users-bounces at dancer.pm on behalf of cwallace at lodgingcompany.com> wrote:

>On Tue, 22 Mar 2016 17:08:18 +0000
>Wanjuan Yang <wy1 at sanger.ac.uk> wrote:
>
>> I have a template:
>> The first part is a form with a drop down list.
>> The second part of the template consists different tabs.
>> 
>> By selecting from the list, it shows different content in the second
>> part of the template.
>> 
>> But I want to change the drop down list content when switch between
>> tabs. How can I do it?

     

>I don't think you need to change your template at all.  You need to
>change the contents of the array in $tissues, which is probably built
>using a query from your database.  The key is to find out what tab
>you're on in your app (probably based on some param), and then modify
>your query based on what types of data you want to see for each tab.
>
>If you post the code for your app, I could be more specific.

Thanks for your reply.

I can now detect which tab I am on, and get the tissue list from backend.
How to re-populate the tissue list(the select section in the template) using jquery?

Thanks in advance!

Wendy





>
>
>> The simplified version of the codes look like:
>> 
>>   <div class="panel">
>>     <h3 >Select a tissue specific analysis: </h3>
>>     <div class="filt_options">
>>        <form action=“/someaction/&" method="post" autocomplete="off">
>>            <select name="tissue" class="tissue_selector">
>>                  <?pl foreach my $tissue ( @$tissues ){ ?>
>>                     <option value="[== $tissue->[1] =]"> [==
>> $tissue->[0] =]</option> <?pl } ?>
>>         </select>
>>     </form>
>>     </div>
>> 
>>    <div class="sub_data" id="tissue_selection”>
>>        <ul class="tabs">
>>           <li><a href="#t_first">Overview</a></li>
>>          <li><a href=“#t_second”>Plot</a></li>
>>      </ul>
>> 
>>   <div id="t_first" class=“overview”>
>>   </div>
>> 
>>   <div id=“t_second” class="plot">
>>   </div>
>> </div>
>> </div>
>
>
>-- 
>
>C. Chad Wallace, B.Sc.
>The Lodging Company
>http://www.lodgingcompany.com/
>OpenPGP Public Key ID: 0x262208A0
>
>_______________________________________________
>dancer-users mailing list
>dancer-users at dancer.pm
>http://lists.preshweb.co.uk/mailman/listinfo/dancer-users


More information about the dancer-users mailing list