2013-03-30 5 views
0

Мне нужно отобразить около 500 строк в LiveGride. Моя функция занимает около 6 минут , чтобы перенастроить Json Array.Grid показывает загрузку около 2 минут, затем останавливается. Когда я щелкал в режиме отладки, сетка сначала не работает, но функция все еще работает и возвращает последний.Extjs Сетка не загружает большие данные

Программа прекрасно работает с меньшим кола-во данных

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(), 

}); 
+0

Возможно, вы столкнулись с проблемой таймаута ajax, проверьте свои настройки. – dbrin

+0

Да, возможно, и если вы хотите увеличить время ожидания вашего магазина. Загрузка слишком большого количества данных приведет к удалению памяти, хотя –

+1

вы можете определить тайм-аут ajax следующим образом: 'Ext.Ajax.timeout = 360000; // 6 минут = 360000 миллисекунд' – vtokmak

ответ

1

Я применил переопределение функции 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; 
    } 
}); 
Смежные вопросы