Ext页面根据查询条件 得出的List数据在action已经得到了 怎么在GridPanel中重新加载一次呢?Ext.getCmp('Ext.system.logFormPanel').form.submit({
url : BASE_PATH + '/system/QueryLogByCond.action',
waitTitle : '提示',
method : 'POST',
waitMsg : '正在提交数据,请稍候.....',
success : function(form, action) {
logGridPanel.store.proxy
// 刷新表格
logGridPanel.store.reload({ params : { start : 0, limit : 15} });
},
failure : function(form, action) {
Ext.Msg.alert("提示", "返回数据出错!");
},
scope : this
});

解决方案 »

  1.   

    你是要把得到的数据加载到GRIDPANEL?
    可以直接把数据插入到 store中去。
      

  2.   

    1.可以store.loadData();
    2.可以store.load({params:{}});
      

  3.   

     logGridPanel.store.reload({ params : {    start : 0,    limit : 15}    });//没有这样的写法。
    reload方法不带参数
      

  4.   

    我这里试图改成 logGridPanel.store.proxy = new Ext.Ext.data.HttpProxy({}) 类似的 就是报错呢search = function(){
                if (!Ext.getCmp('Ext.system.logFormPanel').form.isValid()) {
                    Ext.MessageBox.alert('提示', '请将数据填写完整');
                    return;
                }
                Ext.getCmp('Ext.system.logFormPanel').form.submit({
                    url : BASE_PATH + '/system/QueryLogByCond.action',
                    waitTitle : '提示',
                    method : 'POST',
                    waitMsg : '正在提交数据,请稍候.....',
                    success : function(form, action) {
                        
                        // 刷新表格
                        logGridPanel.store.reload({ params : {    start : 0,    limit : 15}    });
                    },
                    failure : function(form, action) {
                        Ext.Msg.alert("提示", "返回数据出错!");
                    },
                    scope : this
                });
            }
      

  5.   

    Ext.getCmp('Ext.system.logFormPanel').form.submit({
        url: BASE_PATH + '/system/QueryLogByCond.action',
        waitTitle: '提示',
        method: 'POST',
        waitMsg: '正在提交数据,请稍候.....',
        success: function(form, action) {
            //这里是不是返回了正确的数据
            var result = Ext.decode(action.result);
            store.loadData(result);
        },
        failure: function(form, action) {
            Ext.Msg.alert("提示", "返回数据出错!");
        },
        scope: this
    });//其实你完全不用这种方法来做的//查询grid建议这样做
    store.load({ params: Ext.apply({ start: 0, limit: 15 }, Ext.getCmp("Ext.system.logFormPanel").form.getValues()) });
    //这样就直接加载到grid中了。
    //用到分页的话就要用store.setBaseParam方法了。
      

  6.   

    按照你说的这样来弄,结果是Ext.Msg.alert("提示", "返回数据出错!");
    search = function(){
    Ext.getCmp('Ext.system.logFormPanel').form.submit({
    url : BASE_PATH + '/system/QueryLogInfo.action',
    waitTitle : '提示',
    method : 'POST',
    waitMsg : '正在提交数据,请稍候.....',
    success : function(form, action) {
    var result = Ext.decode(action.result);
            logGridPanel.store.loadData(result);
    // 刷新表格
    // logGridPanel.store.reload({ params : { start : 0, limit : 15} });
    },
    failure : function(form, action) {
    Ext.Msg.alert("提示", "返回数据出错!");
    },
    scope : this
    });
    }
    我在后台使用的是struts2/**
     * 查询日志信息, 用于显示在GridPanel 中
     * */
    public String queryLogInfo(){
    success = true;
    // 获取ActionContext对象,通过context对象获取页面请求参数
    ActionContext context = ActionContext.getContext();
    Map params = context.getParameters();
    // 获取表单页面元素start
    String[] starts = (String[]) params.get("start");
    String start = "";
    if (starts != null && starts.length > 0) {
    start = starts[0];
    }
    // 获取表单页面元素limit
    String[] limits = (String[]) params.get("limit");
    String limit = "";
    if (limits != null && limits.length > 0) {
    limit = limits[0];
    }
    logInfoList = service.queryLogInfo(start, limit, startTime, endTime, keyWord);
    try {
    totalCount = service.queryCount();
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    return SUCCESS;
    }
      

  7.   

    这部分代码能代替我我上面写的么?store.load({ params: Ext.apply({ start: 0, limit: 15 }, Ext.getCmp("Ext.system.logFormPanel").form.getValues()) });
      

  8.   

    你的grid初始数据与search不是共用一个action?
    你search时只需要重新设置store的baseParams即可