1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    59
    Vote Rating
    0
    dddesign is on a distinguished road

      0  

    Default custom function in Ext.application not working after build package

    custom function in Ext.application not working after build package


    I need a global variable in my views and store. after searching the forum I found this solution:

    Code:
    Ext.application({
        name: 'PhotoMoonTool',
        ....
        getSection: function() {
            url_args = window.location.toString().split("?");
            if (url_args[1]) {
                url_args = Ext.Object.fromQueryString(url_args[1]);
                return url_args.section + '/';
            } else {
                return '';
            }
        }
        ....
    });
    and in views I use it as this:
    Code:
           ....
           itemTpl: [
                '<img src="http://www.moontools.ch/photo-moon-tool/'+ PhotoMoonTool.app.getSection() +'images/{folder_name}/{img_name}001{name_zusatz}.jpg" >' +
           ]
           ....
    this is working, check here:
    http://mobile.moontools.ch/photomoontool1/
    and http://mobile.moontools.ch/photomoontool1/?section=manu

    but if I build a webapp ("sencha app build package" or "sencha app build production") I get some errors (getSection is not defined). see here:
    http://mobile.moontools.ch/package and
    http://mobile.moontools.ch/production/ (this is production)

    any hint how I can solve this?
    thanks a lot. j

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    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

      0  

    Default


    That's because your classes are defined before the application actually gets instantiated. You should elevate such required methods into a utils namespace. Include that before any other classes, and it will work fine. I did this for both the SenchaCon 2011 and DiscoverMusic applications.

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