java - Extjs Grid 无法加载大数据

标签 java jsp extjs

我需要在 LiveGride 中显示大约 500 行。我的函数大约需要 6 分钟 重新调整 Json Array.Grid 显示加载大约 2 分钟然后停止。 当我使用 Debug模式进行检查时,网格首先失败,但该函数仍在运行并最后返回。

程序运行良好,数据较少

var Grid = new Ext.ux.grid.livegrid.EditorGridPanel

({
title: 'Report Details',
id: 'GridId',
ds: Store,
cm: CM,

view: new Ext.ux.grid.livegrid.GridView({
nearLimit: 3,

loadMask: {
            msg: 'Loading Records PleaseWait.....!'
        },

emptyText: 'No Records Found'
    }),

stripeRows: true,

border: true,
    width: screen.width - 90,
    height: 340,

loadMask: {
        msg: ' Loading Records Please Wait......!'
    },
    clicksToEdit: 1,
    plugins: filters,

selModel: new Ext.ux.grid.livegrid.RowSelectionModel(),

});

最佳答案

我应用了 Ext.data.HttpProxy.doRequest 函数的重写来接受来自 Store.load(params) 的超时属性并创建存储。

    Ext.override(Ext.data.HttpProxy, {
    doRequest: function (action, rs, params, reader, cb, scope, arg) {
        var timeout = 30000;
        if (scope.timeout > 0) timeout = scope.timeout;
        if (arg.timeout > 0) timeout = arg.timeout;
        var o = {
            method: (this.api[action]) ? this.api[action]['method'] : undefined,
            request: {
                callback: cb,
                scope: scope,
                arg: arg
            },
            reader: reader,
            callback: this.createCallback(action, rs),
            scope: this,
            timeout: timeout
        };

        // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.).
        // Use std HTTP params otherwise.
        if (params.jsonData) {
            o.jsonData = params.jsonData;
        } else if (params.xmlData) {
            o.xmlData = params.xmlData;
        } else {
            o.params = params || {};
        }
        // Set the connection url.  If this.conn.url is not null here,
        // the user must have overridden the url during a beforewrite/beforeload event-handler.
        // this.conn.url is nullified after each request.
        this.conn.url = this.buildUrl(action, rs);

        if (this.useAjax) {

            Ext.applyIf(o, this.conn);

            // If a currently running read request is found, abort it
            if (action == Ext.data.Api.actions.read && this.activeRequest[action]) {
                Ext.Ajax.abort(this.activeRequest[action]);
            }
            this.activeRequest[action] = Ext.Ajax.request(o);
        } else {
            this.conn.request(o);
        }
        // request is sent, nullify the connection url in preparation for the next request
        this.conn.url = null;
    }
});

关于java - Extjs Grid 无法加载大数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15717358/

相关文章:

java - 执行 Runtime.getRuntime().exec AWK 时出现问题

eclipse - 如何让 Eclipse 正确格式化 JSP 代码?

java - 从第一个下拉列表jsp中获取值

extjs - 获取 Ext JS 版本

extjs - 如何强制 ExtJS NumberField 中的小数显示达到一定的精度?

javascript - 验证功能不起作用

java - 尝试执行 httppost 时应用程序崩溃

java - 找不到 bundle java.util.PropertyResourceBundle 的资源

java - Android 每次访问页面时都运行 Java

javascript - (JavaFX WebEngine) JavaScript 到 Java 调用工作不一致