1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
    cweirich is on a distinguished road

      0  

    Default Grid doesn't show data

    Grid doesn't show data


    Hello.

    I'm evaluating Architect for possible use in a project and having trouble displaying data using a grid.

    I've created a store and a model to retrieve data from a database, and it's working fine. If I go to 'Load Data' it shows the eye beside the store and shows the data inside the grid, but when previewing it in the browser, the grid is always empty.

    Funny thing is, if I copy the json from the response, save it to a file and point the proxy url to this file, the data displays inside architect and in the browser too.

    Please let me know what I could be missing and what code could I paste here to make things clearer.

    Thanks.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    This happens usually when you dont have autoLoad on Store set to true. But i seems like it is loading when changing the url to point to a file? Could you attach store configuration here.
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
    cweirich is on a distinguished road

      0  

    Default


    Hi,

    Here is the store I'm using:

    Code:
    Ext.define('MyApp.store.Clients', {
        extend: 'Ext.data.Store',
        requires: [
            'MyApp.model.Client'
        ],
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                autoLoad: true,
                storeId: 'Clients',
                model: 'MyApp.model.Client',
                proxy: {
                    type: 'rest',
                    url: 'http://localhost:24738/Client',
                    reader: {
                        type: 'json'
                    },
                    writer: {
                        type: 'json'
                    }
                }
            }, cfg)]);
        }
    });
    If I just change 'url' to 'clients.json' (which has the same content as the response returned by the server), it works.

    Thanks.

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    What does http://localhost:24738/Client return in the browser? same response as in client.json?

    Typically you have application name as part of the request so
    http://localhost:24738/appname/Client.php for example. I believe your url is incorrect.
    Bharat Nagwani
    Sencha Designer Development Team

  5. #5
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
    cweirich is on a distinguished road

      0  

    Default


    No the url is fine, it's just in asp.net development server, so I don't need an app name.

    As I said above, when I right click the store and choose "Load Data", it loads correctly and shows the json returned from the server. This was the response that I used to create the clients.json file.

    Also, inside architect it shows the data correctly, it's just empty when I try to preview it.

  6. #6
    Sencha User
    Join Date
    Apr 2007
    Location
    Italy/UK
    Posts
    152
    Vote Rating
    0
    sj137 is on a distinguished road

      0  

    Default i'm having the same problem

    i'm having the same problem


    i have autoload is set to true, too.

    and everything seems to be linked up ok..

    when i right-click the store in the project inspector, and click 'Load Data' it loads the json fine, and afterwards says 'records loaded' and i can view the response,
    but for me nothing shows up in architech or when i try to preview...

    in firebug console i see it load up the store file, then the model file, but not the data...

    ps i'm using a tree-grid

    many thanks in advance for help

  7. #7
    Sencha User
    Join Date
    Apr 2007
    Location
    Italy/UK
    Posts
    152
    Vote Rating
    0
    sj137 is on a distinguished road

      0  

    Default now my problem is exactly the same

    now my problem is exactly the same


    i added an extra controller that simply refs the store, model and view
    and now the data shows up in architect!

    but not in preview....

  8. #8
    Sencha User
    Join Date
    Apr 2007
    Location
    Italy/UK
    Posts
    152
    Vote Rating
    0
    sj137 is on a distinguished road

      0  

    Default ok *kinda* fixed

    ok *kinda* fixed


    in my new controller i added the following to two lines into the init() method, and now the data shows up
    in preview....

    Code:
    var myJsonTreeStore = Ext.getStore("MyJsonTreeStore");
    
    myJsonTreeStore.load();
    however shouldn't this happen automagically somehow?

  9. #9
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
    cweirich is on a distinguished road

      0  

    Default


    I've tried creating a controller to manually load the store data, but it's still not working.

    The controller I used is this one:

    Code:
    Ext.define('MyApp.controller.ClientsController', {
        extend: 'Ext.app.Controller',
    
        stores: [
            'Clients'
        ],
    
        onLaunch: function() {
            this.getClientsStore().load();
        }
    
    });

  10. #10
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
    cweirich is on a distinguished road

      0  

    Default


    Solved it.

    I noticed the requests made to the server when previewing were OPTIONS, not GET, and it turned out it was because of https://developer.mozilla.org/En/HTTP_access_control as the other app was running in a different context / port.

    I simply copied the ExtJs project folder into the other project and now it works perfectly.

    In the end, it has nothing to do with ExtJs, but the fact that the request is a GET from inside architect and OPTIONS when executing the javascript can be confusing. Maybe it's worth an entry in your grids/store documents.

Thread Participants: 4

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..."