我刚接触ExtJs不久、希望懂这个的高手们能帮我讲解这个问题。谢谢我用severlet从数据库里面获得了数据并将这些数据放到了list里面,现在我要在前台用ExtJs去动态获取这些数据,并将它们显示出来。我可以直接在界面静态显示数据,但是动态的真的懵了。麻烦你们帮忙看看,谢谢了

解决方案 »

  1.   

    你需要返回json格式 比如:
    {
        "message": "",
        "root": [{
             "activeplace": "发的萨芬",
            "activerule": "范德萨发的撒",
            "activitycontent": "的所发生的",
            "note": "v刹范德萨",
            "organsort": "2"
        },
        {
            "activeplace": "发的萨芬",
            "activerule": "范德萨发的撒",
            "activitycontent": "的所发生的",
            "note": "v刹范德萨",
            "organsort": "2"
        },
        {
             "activeplace": "发的萨芬",
            "activerule": "范德萨发的撒",
            "activitycontent": "的所发生的",
            "note": "v刹范德萨",
            "organsort": "2"
        }],
        "success": true,
        "total": 3
    }
      

  2.   


            this.store = Ext.create('Ext.data.Store', {
                autoLoad: true,
                fields: ['name', 'thumb', 'url', 'type'],
                proxy: {
                    type: 'ajax',
                    url : 'icons.json',
                    reader: {
                        type: 'json',
                        root: ''
                    }
                }
            });
    URL换一下就行了
      

  3.   

    建议初学者可以看看官方的example