views:

165

answers:

0

I'm wanting to do a load of several combobox / FilteringSelect. What happens is that I have 4 combobox / FilteringSelect.

Country Destination Hotel Comfort Classes

these combos is related, when you load the page first loads the Country combobox depending on the country that bear the combobox is selected Destination So far so good when I select a destination combobox loads the data from the Comfort Hotel and Classes, what I want is to make a charger for these last two combobox (Hotel and Comfort Classes), which happen to have a lot of data and delay in displaying the information and would like to display a magazine so that users know that is processing the data and have to wait to load.

if anyone has any idea how to perform this process will be obliged to me please take a hand.

Here is the code I'm using to display the data in the combobox:


function changeCountry(country){
    showdiv();
    var VarUrl = "<?php echo WWW_ROOT.'travelprofessionals'.DS; ?>mytp/rates/destinationjson/"+country;
    var type_store = new dojo.data.ItemFileReadStore( {
        url : VarUrl
    });
    dijit.byId('destination').store = type_store;
    dijit.byId('destination').store.fetch();
    dijit.byId('destination').setDisplayedValue('Select One', false);
    hidediv();}

function changeDestination(destination){
showdiv();
    if (destination.getDisplayedValue()!='<?php echo $this->translate('Select One'); ?>') {
        cleanCombos = true;
     switch(country.attr('value'))
     {
      <?php
            foreach($this->manuals as $values){                
            ?>                    
      case '<?php echo $values['country']; ?>':
       salesmanual = '<?php echo $values['salesmanual']; ?>';
       break;
            <?php
            }
            ?>
     }

     store1.close();

     store1._jsonFileUrl = "<?php echo WWW_ROOT.'travelprofessionals'.DS; ?>mytp/rates/hoteljson/"+salesmanual+"/"+destination;
     store1.fetch();
     hotelsgrid._refresh();

        hotelStore.clearOnClose = true;
        var VarUrlHotel = "<?php echo WWW_ROOT.'travelprofessionals'.DS; ?>mytp/rates/createhotelcombo/hotel/"+salesmanual+"/"+destination;
        var type_store_Hotel = new dojo.data.ItemFileReadStore( {
            url : VarUrlHotel
        });
        dijit.byId('hotel').store = type_store_Hotel;
        dijit.byId('hotel').store.fetch();
        dijit.byId('hotel').attr('value', 0);
        dijit.byId('hotel').setDisplayedValue('<?php echo $this->translate('All Hotels'); ?>', false);

        classStore.clearOnClose = true;
        var VarUrlClassStore = "<?php echo WWW_ROOT.'travelprofessionals'.DS; ?>mytp/rates/createhotelcombo/class/"+salesmanual+"/"+destination;
        var type_store_ClassStore = new dojo.data.ItemFileReadStore( {
            url : VarUrlClassStore
        });
        dijit.byId('comfortClass').store = type_store_ClassStore;
        dijit.byId('comfortClass').store.fetch();
        dijit.byId('comfortClass').attr('value', 0);
        dijit.byId('comfortClass').setDisplayedValue('<?php echo $this->translate('All Comfort Classes'); ?>', false);

        hidediv();
    }
    return false;}


<input dojoType="dijit.form.FilteringSelect" autoComplete="false" hasDownArrow="true" searchAttr="name" queryExpr="*${0}*" ignoreCase="true" store="countryStore" name="country" id="country" jsid="country" onChange="changeCountry(this)" required="false" />

<input dojoType="dijit.form.FilteringSelect" store="destinationStore" name="destination" id="destination" jsid="destination" onChange="changeDestination(this)" required="false" >

<input name="hotel" jsid="hotel" value="*" store="hotelStore" id="hotel" dojotype="dijit.form.FilteringSelect" onchange="reSearch()" required="false" >

<input name="comfortClass" jsid="comfortClass" value="*" store="classStore" id="comfortClass" dojotype="dijit.form.FilteringSelect" onchange="reSearch()" required="false" >