1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Chicago, IL
    Posts
    10
    Vote Rating
    0
    dzinyo00 is on a distinguished road

      0  

    Default Unanswered: Activate a Sencha Touch tab from a custom JS function

    Unanswered: Activate a Sencha Touch tab from a custom JS function


    I have a Cordova project on iOS and I want to switch to a specific tab following an event 'X'.


    Assuming event 'X' just occurred, my objective C makes the following call to run a JS function `openNotificationTab()` like so:


    Code:
    NSString *goToNotification = [NSString stringWithFormat:@"openNotificationTab()"];
        [viewController.webView stringByEvaluatingJavaScriptFromString:goToNotification];
    The `openNotificationTab()` function resides in filename.js and I verified it is within scope and accessible by testing with an `alert()`.


    Now the definition for my js function is as follows:


    Code:
    function openNotificationTab(){
            Ext.Viewport.setActiveItem({
            xtype: 'notificationtabview'
        	});
        }
    The problem is that this function opens the correct panel, but overlays it on top of everything else. So the entire tab menu is no longer visibile and thus inaccessible.


    I also tried



    Code:
    "Ext.Viewport.setActiveItem(1)" and  "Ext.Viewport.setActiveItem('notificationtabview')"
    but neither does anything. Thanks for your help.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Answers
    101
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      1  

    Default


    You're doing it to the viewport, so it will make things full screen or floating.

    You need to add the tab to the tabpanel itself, and tell the tab panel to set that child as the active item.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Chicago, IL
    Posts
    10
    Vote Rating
    0
    dzinyo00 is on a distinguished road

      0  

    Default


    So something like this?

    Code:
    Ext.Viewport.down("tabpanel").setActiveItem(tab-index)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar