0

我正在尝试从 4.0.7 升级到 Extjs4.1 我的应用程序窗口现在似乎很好,但所有网格和树中都没有显示数据!尽管数据是从服务器端返回的,即使我用于菜单的静态文件(如布局浏览器示例中)也不起作用

这是我的 menu.json

{ 
text: '.',
children: [{

                    text:'Dashboard - <font size=1>Overview</font>',
                    id:'dash',
                    iconCls:'dashIcon',
                    leaf:true
                 },{
                    text:'Services - <font size=1>Analyze</font>',
                    id:'multiserv',
                    iconCls:'multiservIcon',
                    leaf:true
                 },{
                    text:'Reports - <font size=1>Results</font>',
                    id:'report',
                    iconCls:'reportingIcon',
                    leaf:true
                 },{
                    text:'Options - <font size=1>Settings</font>',
                    id:'options',
                    iconCls:'optionsIcon',
                    leaf:true

                }]

}

这是服务器返回的数据示例

{"id":1,"result":"[\r\n  {\r\n    \"Item1\": \"demo\",\r\n    \"Item2\": 5,\r\n        \"Item3\": 15,\r\n    \"Item4\": \"4308,0\",\r\n    \"Item5\": \"oct. 14, 2012\",\r\n    \"Item6\": \"demo\",\r\n    \"Item7\": \"sept. 14, 2011\"\r\n  }\r\n]"}

标题:

Accept:
*/*

Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.3

Accept-Encoding:
gzip,deflate,sdch

Accept-Language:
fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4

Cache-Control:
no-cache

Content-Length:
  47

Content-Type:
application/json; charset=UTF-8

这是我的网格之一:

Ext.define("Ext.app.LastAdresses", {
  extend: "Ext.form.Panel",


columnWidth: 0.55,
title: 'Overview',
padding: ' 5 5 5 5',
animCollapse: true,
draggable: true,
resizable: true,
width: 750,
height: 380,
layout: 'column',
autoScroll: true,
fieldDefaults: {
    labelAlign: 'left',
    msgTarget: 'side'
},
items: [{
    columnWidth: 0.57,
    xtype: 'grid',
    store: LStore,
    height: 345,
    width:400,
    layout:'fit',
    frame: false,
    padding: '5 5 5 5',
    viewConfig: { emptyText: ' <div class="noData"> No Available Data for Now </div>' },
    columns: [
        {
            text: 'Date',
            width: 85,
            renderer: Ext.util.Format.dateRenderer('d-M-Y'), 
            sortable: true,
            dataIndex: 'DateEnd'
        }
        , {
            text: 'Adress',
            width: 140,
            sortable: true,
            renderer: 'htmlEncode',
            dataIndex: 'Current'
        },
        {
            text: '# ',
            width: 60,
            sortable: true,
            renderer: 'htmlEncode',
            dataIndex: 'nbr'
        }
      , {
          text: 'ScoRISK',
          width: 55,
          sortable: true,
          renderer: change,
          dataIndex: 'Score'
      }, {
          text: 'Type ',
          width: 150,
          sortable: true,
          renderer: 'htmlEncode',
          dataIndex: 'Category'
      }
    ],


    listeners: {

        afterrender: function () {
            this.view.refresh()


        },
        selectionchange: function (sm, selectedRecord) {
            if (selectedRecord.length) {
                var detailPanel3 = Ext.getCmp('detailPanel3');
                assetsTpl.overwrite(detailPanel3.body, selectedRecord[0].data);
            }
        }
    }


}, {
    columnWidth: 0.43,
    margin: '0 5 0 5',
    border: false,
    layout: 'anchor',
    width:200,height:400,
    items: [{ xtype: 'fieldset',
        title: 'Findings Detail',
        items: [{
            id: 'detailPanel3',
            flex: 1,
            height: 160,
            width: 400,
            layout: 'fit',
            border: false,
            bodyPadding: 7,
            bodyStyle: "background: #ffffff;",
            html: '<br>Please Select an Item to See Additional Details.'
        }]

    }]
}


  ]


});

让我知道你是否需要别的东西

需要注意的是,我检查了商店的长度

var recs=store.getRange(); 
alert(recs.length); 

它给出了 48

4

0 回答 0