1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    40
    Vote Rating
    0
    pkvenu is on a distinguished road

      0  

    Default Disable set active item in a controller when data returned is empty

    Disable set active item in a controller when data returned is empty


    I have a controller as shown below:

    Code:
      showMapBasedOnInputLocation: function (options) {
            GetData(options.id[0], options.id[1]);
            Ext.getCmp('FilterSelect').setOptions([
                { text: 'Availability', value: 'Availability' },
                { text: 'Price', value: 'Price' },
                { text: 'Proximity', value: 'Proximity' }
            ]);
            Ext.getCmp('mytab').setActiveItem(0);
            map.graphics.clear();
            this.application.viewport.setActiveItem(
                App.views.result,
                 {
                     type: 'slide',
                     direction: 'right'
                 }
               );
    
        },
    Here i don't want to set the active items if the data in the store is empty.
    Code:
    if(App.stores.ParkingFacility.data.items.length > 0)
    {
     this.application.viewport.setActiveItem(
                App.views.result,
                 {
                     type: 'slide',
                     direction: 'right'
                 }
               );
    }
    but does not seem to work.

    Any suggestion or ideas i could use.

    Regards,
    Pawan

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You have a timing issue. Why not have the if statement with in your first code snippet?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    40
    Vote Rating
    0
    pkvenu is on a distinguished road

      0  

    Default


    I do have it in my first Statement. I think the problem is the GetData() method make a jsonp request and once the jsonp request (asynchronous ) is executed it immediately passes control to controller back and executes the code below.
    Code:
    this.application.viewport.setActiveItem(
                App.views.result,
                 {
                     type: 'slide',
                     direction: 'right'
                 }
               );
    Is there any way i could make it wait until i get all my data back and then execute the set active method. can you help me out with any sample code.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi