1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
    franck.pedrini is on a distinguished road

      0  

    Default Problem with setting api parameter under Config in Ajax Proxy

    Problem with setting api parameter under Config in Ajax Proxy


    Hello everyone,
    I just got started with Sencha Architect 2 and for my first project I followed along the working example found at:
    http://www.sencha.com/forum/showthre...-Architect-how
    (The fourth post by d.velev has said project attached).

    Now, I looked at the scripts to familiarise myself with the framework, and decided to create my own CRUD application via Architect, when I run up against the following problem;
    when I create a JsonStore from the Inspector, and select the Ajax Proxy, I wish to enter the four .php files that map to the four CRUD operations, like so:
    Code:
        read: "data/readUser.php",
        update: "data/updateUser.php",
        create:  "data/createUser.php",
        destroy: "data/destroyUser.php"

    so that part of the script would look like this:
    Code:
    ...
    proxy: {
            type: 'ajax',
            api: {
                read: 'data/readUser.php',
                update: 'data/updateUser.php',
                create: 'data/createUser.php',
                destroy: 'data/deleteUser.php'
            },
            reader: {
                        type: 'json',
                        root: 'data'
            }
    ...
    But when I open up Architect and navigate under Config, api, in the AjaxProxy of my JsonStore, all I can enter is a string of text which then automatically generates the following code:
    Code:
    ...
    proxy: {
                    type: 'ajax',
                    api: 'read: "data/readUser.php",\n    update: "data/updateUser.php",\n    create: "data/createUser.php",\n    destroy: "data/destroyUser.php"',
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                }
    ...

    which obviously doesn't work.
    I wonder what has to be entered in the 'api' field in order for Architect to generate the code I'm after.

    Thanks in advance for your help,

    Frank

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,182
    Vote Rating
    119
    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


    You need to wrap what you entered in curly braces.

    Code:
    {
    // what you have currently
    }
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,182
    Vote Rating
    119
    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


    You pasted in
    Code:
        read: "data/readUser.php",
        update: "data/updateUser.php",
        create:  "data/createUser.php",
        destroy: "data/destroyUser.php"
    For the api config, you should have pasted in
    Code:
    {
        read: "data/readUser.php",
        update: "data/updateUser.php",
        create:  "data/createUser.php",
        destroy: "data/destroyUser.php"
    }
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
    franck.pedrini is on a distinguished road

      1  

    Default


    Sorted, thanks.
    Should I feel ashamed it was that simple? eheh

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