1. #11
    Ext User
    Join Date
    Oct 2007
    Posts
    18
    Vote Rating
    2
    mcarsel is on a distinguished road

      0  

    Default


    Animal: xg.dummydata was some cruft left over from a grid example I'm mimicking. It was in an optional argument so I removed it and got a little bit farther.

    Now the error is:

    Error: this._windows[aWindow.__SSi] has no properties
    Source File: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js
    Line: 777

  2. #12
    Sencha User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    2
    JoeK is on a distinguished road

      0  

    Default


    Quote Originally Posted by cobnet View Post
    Just a hint, take one of the examples and replace a line in the example, then test it. Replace lines piece by piece and you will find out where you are going wrong.
    This is excellent advice. Thanks.

  3. #13
    Ext User
    Join Date
    Oct 2007
    Posts
    18
    Vote Rating
    2
    mcarsel is on a distinguished road

      0  

    Default


    Removed expander and restarted browser. That cleared up the last error.

    Now getting no errors. The grid shows headers, but is empty.

    This is the current code:

    HTML Code:
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
        
        var xg = Ext.grid;
    
        // shared reader
        var electronicDevice = Ext.data.Record.create([
           { name : 'id'}, { name : 'model'}, { name : 'deviceType'}, { name : 'netBandwidth'}
        ]);
        
        var reader = new Ext.data.JsonReader({
     	   root : "properties",
     	   totalProperty : "total",
     	   id : "id"
        }, electronicDevice);
        
        var store = new Ext.data.Store({
    	 nocache : true,
           reader : reader,
           autoLoad : true,
    	   remoteSort : true,
    	   proxy : new Ext.data.HttpProxy({
    	       url : '/getjson?queryable=featureType&featureType=Electronic Device',
    	       method : 'GET'
    	   })
    	});
    
        var grid1 = new xg.GridPanel({
            ds: new Ext.data.Store({
                reader: reader
            }),
            cm: new xg.ColumnModel([
            {id : 'id', header : "Feature Number", width: 8, dataIndex : 'id'},
            {header: "Model", width: 10, dataIndex: 'model'},
            {header: "Device Type", width: 10, dataIndex: 'deviceType'},
            {header: "Net Bandwidth", width: 10, dataIndex: 'netBandwidth'}
            ]),
            viewConfig: {
                forceFit:true
            },
            width: 600,
            height: 300,
            collapsible: true,
            animCollapse: false,
            title: 'Electronic Devices',
            iconCls: 'icon-grid',
            renderTo: document.body
        });
    
    });

  4. #14
    Sencha User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    2
    JoeK is on a distinguished road

      0  

    Default


    I'm just one step ahead of you.

    After you define your grid, try store.load(); (Though you'd think autoLoad would do that for you...that ended up being my problem.)

  5. #15
    Ext User
    Join Date
    Mar 2007
    Location
    Nashville, TN
    Posts
    112
    Vote Rating
    0
    cobnet is on a distinguished road

      0  

    Default


    Look here:

    Code:
            ds: new Ext.data.Store({
                reader: reader
            }),
    try this:

    Code:
            ds: store
    Your store may need a column model as well?

  6. #16
    Ext User
    Join Date
    Oct 2007
    Posts
    18
    Vote Rating
    2
    mcarsel is on a distinguished road

      0  

    Default


    cobnet: OK, that helped! I also changed root: "properties" to root: "features". Now I'm getting 10 rows populated in the grid with ids only. Look back at my original post in this thread: "properties" is a nested object. Can the Ext JsonReader handle something like this?

  7. #17
    Ext User
    Join Date
    Mar 2007
    Location
    Nashville, TN
    Posts
    112
    Vote Rating
    0
    cobnet is on a distinguished road

      0  

    Default


    Quote Originally Posted by mcarsel View Post
    cobnet: OK, that helped! I also changed root: "properties" to root: "features". Now I'm getting 10 rows populated in the grid with ids only. Look back at my original post in this thread: "properties" is a nested object. Can the Ext JsonReader handle something like this?
    Ok, I have gone as far as my knowledge will let me go on this one. I am sure the JsonReader can handle this, it is just a matter of letting the grid know what coming at it. I will keep looking at this, but my timeframe and yours may not be the same?

  8. #18
    Ext User
    Join Date
    Oct 2007
    Posts
    18
    Vote Rating
    2
    mcarsel is on a distinguished road

      0  

    Default


    So the question is:

    How do I populate the rest of the grid? Is the answer to modify the following code somehow?

    var electronicDevice = Ext.data.Record.create([
    { name : 'id' }, { name : 'model' }, { name : 'deviceType' }, { name : 'netBandwidth' }
    ]);

  9. #19
    Ext User
    Join Date
    Oct 2007
    Posts
    18
    Vote Rating
    2
    mcarsel is on a distinguished road

      0  

    Default Solution

    Solution


    I solved my own problem. Note the use of "properties." to address the nested elements. Thanks everyone who helped along the way.

    HTML Code:
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
        
        var xg = Ext.grid;
    
        var electronicDevice = Ext.data.Record.create([
           { name : 'id'}, { name : 'properties.model'}, { name : 'properties.deviceType'}, { name : 'properties.netBandwidth'}
        ]);
        
        var reader = new Ext.data.JsonReader({
     	   root : "features",
     	   totalProperty : "total",
     	   id : "id"
        }, electronicDevice);
        
        var store = new Ext.data.Store({
           nocache : true,
           reader : reader,
           autoLoad : true,
    	   remoteSort : true,
    	   proxy : new Ext.data.HttpProxy({
    	       url : '/getjson?queryable=featureType&featureType=Electronic%20Device',
    	       method : 'GET'
    	   })
    	});
    
        var grid1 = new xg.GridPanel({
            ds: store,
            cm: new xg.ColumnModel([
            {id : 'id', header : "Feature Number", width: 8, dataIndex : 'id'},
            {header: "Model", width: 10, dataIndex: 'properties.model'},
            {header: "Device Type", width: 10, dataIndex: 'properties.deviceType'},
            {header: "Net Bandwidth", width: 10, dataIndex: 'properties.netBandwidth'}
            ]),
            viewConfig: {
                forceFit:true
            },
            width: 600,
            height: 300,
            collapsible: true,
            animCollapse: false,
            title: 'Electronic Devices',
            iconCls: 'icon-grid',
            renderTo: document.body
        });
        store.load();
    });

  10. #20
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    That's great that you figured it out. What probably would be helpful to others behind you is if you could point out (1) how you figured it out (firebug maybe? and if so how did you use it) and (2) if you understand what the mistake is now explain why it didn't work.
    I think it's very useful learning from prior mistakes.
    Plus, maybe now you've learned more and could offer back where the examples were insufficient. Presumably you could not make the example more 'sufficient'? Just a thought...

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