Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    2
    Vote Rating
    0
    mj2025 is on a distinguished road

      0  

    Default Custom methods (functions) for an item/object

    Custom methods (functions) for an item/object


    Hi,

    Consider the following example code snippet (worked fine in PR3 and previous versions of Sencha Touch I/II)

    Code:
    Ext.application({
        icon: 'resources/images/icon.png',
        glossOnIcon: false,
        tabletStartupScreen: 'resources/images/tablet_startup.png',
        phoneStartupScreen: 'resources/images/phone_startup.png',
    
    
        requires: [
    'Ext.tab.Panel'
        ],
    
    
        launch: function() {
            Ext.Viewport.add({
                xtype: 'tabpanel',
                id: 'root',
                items: [
                    {
                        id: 'example',
                        title: 'Home',
                        iconCls: 'home',
                        html: [
    '<img src="http://staging.sencha.com/img/sencha.png" />',
    '<h1>Welcome to Sencha Touch</h1>',
    "<p>You're creating the Getting Started app. This demonstrates how ",
    "to use tabs, lists and forms to create a simple app</p>",
    '<h2>Sencha Touch (2.0.0)</h2>'
                        ].join(""),
                        
                        customFn1: function () { alert('customFn1'); }
    
    
                    }
                ]
            });
            var panel = Ext.Viewport.getComponent('root').getComponent('example');
            panel.customFn1(); // <-- THIS FAILS
        }
    });
    
    
    
    ...
    
    ...

    At the moment the above fails since starting with (at least) Beta 2 ST 2.0 Release. It turns out that customFn1 is not applied to the 'example' instance, but its rather copied to the example.config attribute. I do have a workaround, but was wondering if there is any 'legal/supported' way to make this work as I have loads of code that use this approach. Please note that in previous versions the 'scope' was the item itself which was very handy.

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This will not work without compatibility mode turned on. If you want to do this type of thing, you would need to access the config object like you mentioned. It's not something we encourage doing.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 1

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