Link to home
Start Free TrialLog in
Avatar of bogartusmaximus
bogartusmaximusFlag for United States of America

asked on

ExtJS datagrid empty data

I have an ExtJS datagrid that works fine in chrome and firefox, but is showing as empty in IE8.  IE is necessary as this is a corporate environment and all of our 3rd party software and websites work in IE and not in the other browsers. The browser war doesn't really matter to me as long as this code can be fixed.  Here is what I am doing:

The code I'm using goes as follows:

Ext.onReady(function(){

  var dstore = new Ext.data.JsonStore({
url: '/loads.json',
root: 'Loads',
fields: ['PO_NUMBER','ORIGIN','FROM_DATE','DESTINATION','TO_DATE','TRACKLINE','TRAILER','REF_NUMBER','FILENAME'],
mode: 'local',
autoLoad: true
});

  var grid = new Ext.grid.GridPanel({
      store: dstore,
      columns: [
{id: 'PO_NUMBER', header: "PO/BOL #", width: 60,  sortable: true, dataIndex: 'PO_NUMBER'},
{id: 'ORIGIN', header: "Origin City", width: 120, sortable: true, dataIndex: 'ORIGIN'},
{id: 'FROM_DATE', header: "Ship Date", width: 75, sortable: true, dataIndex: 'FROM_DATE'},
{id: 'DESTINATION', header: "Dest. City", width: 120, sortable: true, dataIndex: 'DESTINATION'},
{id: 'TO_DATE', header: "Date Del.", width: 75, sortable: true, dataIndex: 'TO_DATE'},
{id: 'TRACKLINE', header: "Status", width: 200, dataIndex: 'TRACKLINE', renderer: status},
{id: 'TRAILER', header: "Trailer #", width: 50, dataIndex: 'TRAILER'},
{id: 'REF_NUMBER', header: "IGBL #", width: 50,  sortable: true, dataIndex: 'REF_NUMBER'},
{id: 'PODs', header: "PODs", width: 100, sortable: false, dataIndex: 'FILENAME'}
],
stripeRows: true,
autoExpandColumn: 'PODs',
height: 400,
width: 1000,
title:'Loads'
});

      // example of custom renderer function
    function status(val){
        if ( val.match("Delivered")) {
            return '<span style="color:green;">' + val + '</span>';
        }else if( val.match("Enroute")) {
            return '<span style="color:red;">' + val + '</span>';
        }
        return val;
    }



    grid.render('grid-example');
});

the JSON out looks like this:

{ "Loads": [ { "PO_NUMBER": "29302(17 PLTS) ", "ORIGIN": "EL PASO, TX", "DESTINATION": "COMMERCE, CA", "TRAILER": "", "TRACKLINE": "", "REF_NUMBER": "28222", "FROM_DATE": "02/18/2010", "TO_DATE": "02/19/2010", "FILENAME": "" }, ], "Total": "1" }


  It works great in chrome 4 and firefox 3.5, but not in IE8 (i have not tested any other versions of IE).  I have tried using mode 'local' and 'remote' with a relative url and an absolute url.  The only thing I can think of is IE8 has some sort of cross site forgery protection that i don't know how to disable.  I am using ExtJS 3.1 and have added the site to IE8's trusted site list in the Security tab under options.  I am using drupal 6 to generate the JSON code.  Any help would be greatly appreciated, I hope this is just a simple oversight on my part.  Thank you.


ASKER CERTIFIED SOLUTION
Avatar of bogartusmaximus
bogartusmaximus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial