前端是extjs的gridpanel,后端连接数据库,要从 list表中读取所有数据,在 前端的 gridpanel中显示,应该如何做使用的是extjs + C#

解决方案 »

  1.   

    GRIDPANEL不会用……
    //转化为JSON对象
    function jsonTest(){
    var pConnection = new Ext.data.Connection({timeout:1200000});
    pConnection.request({
    method: 'POST',
    url: path + '/testAction.do?method=jsonTest',
    params: null,
    success: function(response, options)
    {
    alert(response.responseText);
    var jsonData = Ext.util.JSON.decode(response.responseText);
    alert(jsonData.aa);
    },
    failure: function(response, options)
    {
    alert("big fail!");
    }
    });
    }
    PS:我是写JAVA的……
      

  2.   

    谢谢LS
    额。。想问下,在前端取到了后面传来的数据,怎样在gridpanel中接收到,
    我用的extjs异步调用,但是gridpanel初始化在 异步函数Ext.Ajax.request之前,当接到返回值的时候,gridpanel已经生成了,我又用了 grid.reconfigure(store,grid.getColumnModel());重装grid,但还是不行求教,该怎么办~~