1. #1
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default Problem with adding CUSTOM CODE to an object

    Problem with adding CUSTOM CODE to an object


    I'd like to setup a custom anims object which is not in the Config panel of SA. It should be something like:
    config: {
    anims: {
    next : {
    type: 'slide',
    direction: 'left'
    }
    previous : {
    type: 'slide',
    direction: 'right'
    }
    }
    },


    I've tried to add an object "anims" in the config panel. But after taping the code, it is automatically changed into:

    config: {
    anims: 'next : {\n type: \'slide\',\n direction: \'left\'\n}\nprevious : {\n type: \'slide\',\n direction: \'right\'\n}'
    }

    So what's the trick to get around this? I gather inserting custom code is very common when using Sencha Architect, isn't it? Thank you in advance.

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    48
    Vote Rating
    2
    tyladurdan is on a distinguished road

      0  

    Default You have to do this...

    You have to do this...


    I had the same problem....but it will work if you write the text in this format:

    { animas: blah blah blah }

    ...all on one line

    :-)

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    This occurs when what you put in is unable to be validated/is not a valid JS Object.

    If you look closely at what you pasted, you will notice that there is a missing , after the `next` object. In the forthcoming Architect 2.2, we provide more warning that it was unable to validate the object (in addition to using a string instead of an object)
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default There's still something missing

    There's still something missing


    Thank you for your help.
    If I add a custom property called "anims", which is a string, following ST's syntax, in a single line:



    {next : {type: 'slide', direction: 'left'}, previous : {type: 'slide', direction: 'right'}}


    I get this:


    config: {
    anims: '{next : {type: \'slide\', direction: \'left\'}, previous : {type: \'slide\', direction: \'right\'}}'
    }


    ====


    I've also tried without inserting commas:


    {next : {type: slide, direction: left}, previous : {type: slide, direction: right}}


    I get then:


    config: {
    anims: '{next : {type: slide, direction: left}, previous : {type: slide, direction: right}}'
    }

    Surely I'm doing something wrong, but I don't get what.
    Attached Images

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Ah! Thanks for the screenshot, helps immensely.

    You've set the anims property to a string, look to the left where the "..." is, if you click on that and select object things should work for you.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default Problem solved

    Problem solved


    You're right. That was tyladurdan's advice but I mixed things up. The code is now correct:

    Ext.define('App.controller.Main', {
    extend: 'Ext.app.Controller',


    config: {
    anims: {
    next: {
    type: 'slide',
    direction: 'left'
    },
    previous: {
    type: 'slide',
    direction: 'right'
    }
    }
    }
    });

    Thank you very much

Thread Participants: 2

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