2013-06-04 6 views
1

Я хочу, чтобы получить бесконечную прокрутку сетку с extjs4 и переменным током # бэкэндом ... я настройка прокси-АФИ в моем контроллере ..ExtJS 4.1 Infinite Сетка скроллинг не работает

My Model:

Ext.define('SCT.model.training.course.TrainingRequirementList', { 
    extend: 'Ext.data.Model', 
    idProperty: 'ID', 
    fields: [ 
     { name: 'ID', type: 'int', convert: null }, 
     { name: 'EmployeeName', type: 'string' }, 
     { name: 'Description', type: 'string' }, 
     { name: 'StatusText', type: 'string' }, 
     { name: 'Status', type: 'int' }, 
     { name: 'Priority', type: 'string' }, 
     { name: 'Date', type: 'string' }, 
     { name: 'Cost', type: 'string' }, 
     { name: 'CanApprove', type: 'bool' }, 
     { name: 'CanRequest', type: 'bool' }, 
     { name: 'ConfirmStatus', type: 'string' }, 
     { name: 'PlanId', type: 'int'} 
    ] 

}); 

Моей Сетка:

{ 
    xtype: 'gridpanel', 
    flex: 1, 
    padding: '0 10 10 10', 
    minHeight: 200, 
    verticalScroller: { 
     xtype: 'paginggridscroller' 
    }, 
    store: { 
     model: 'SCT.model.training.course.TrainingRequirementList', 
     pageSize: 200, 
     autoLoad: true, 

     remoteSort: true, 
     sorters: { 
      property: 'Date', 
      direction: 'DESC' 
     }, 

     proxy: { 
      type: 'direct', 
      extraParams: { 
       total: 50000 
      }, 
      reader: { 
       type: 'json', 
       root: 'ID', 
       totalProperty: 'totalCount' 
      }, 
      simpleSortMode: true 
     } 
    }, 
    columns: 
     [{ 
      text: Lang.Main.Employeee, 
      dataIndex: 'EmployeeName', 
      flex: 1, 
      filterable: true 
     }, 
     { 
      text: Lang.Main.Course, 
      dataIndex: 'Description', 
      flex: 1, 
      filterable: true 
     }, 
     { 
      text: Lang.Main.Status, 
      dataIndex: 'StatusText', 
      flex: 1, 
      filterable: true 
     }, 
     { 
      text: Lang.Main.Priority, 
      dataIndex: 'Priority', 
      flex: 1 
     }, 
     { 
      text: Lang.Main.Date, 
      dataIndex: 'Date', 
      flex: 1 
     }, 
     { 
      text: Lang.Main.Cost, 
      dataIndex: 'Cost', 
      flex: 1, 
      filterable: true 
     }, 
     { 
      text: Lang.Main.Actions, 
      flex: 1, 
      align: 'center', 
      xtype: 'actioncolumn', 
      width: 50, 
      items: [{ 
       icon: 'Design/icons/cog_edit.png', 
       tooltip: Lang.Main.Open, 
       handler: function (grid, rowIndex, colIndex, item) { 
        this.onGridOpen(grid.getStore().getAt(rowIndex)); 
       } 
      }] 
     }],  
    selModel: { mode: 'MULTI', selType: 'checkboxmodel' }, 
} 

настройки прокси-сервер в controoler:

view.grid.getStore().setProxy({ 
      type: 'direct', 
      model: 'SCT.model.training.course.TrainingRequirementList', 
      api: { read: SCT.Service.Training.Plan.GetFilteredRequirements }, 
      extraParams: { total: 50000 }, 
      reader: { 
       type: 'json', 
       root: 'ID', 
       totalProperty: 'totalCount' 
      }, 
      simpleSortMode: true 
     }); 

дополнительной информация о моей точке зрения:

Ext.define('SCT.view.training.course.TrainingRequirements', 
    { 
     extend: 'Ext.panel.Panel', 
     require: [ 'Ext.grid.PagingScroller', 'Ext.ux.grid.FiltersFeature'], 

Моей сетка еще загружают все данные сразу (около 8000 строк ...) ... Я искал решение и работал через учебники .. я все еще не получить его.

пожалуйста, помогите мне ... я не получаю это вообще ...

UPDATE

это мой запрос SRV: enter image description here

и ответ получил 3MB (около 8k наборов данных ...) .. ??

+0

Какова ваша точная версия Ext? Это функция, которая менялась ... – rixo

+1

Также вы уверены, что ваш сервер чтит параметры 'limit' и' start' (или 'page')? Они присутствуют в запросе, который отправляется браузером при загрузке магазина? – rixo

+0

только что обновил мое сообщение ... noob вопрос: как я могу увидеть версию на персидском языке? – JuHwon

ответ

1

Ваш запрос дамп показывает, что Ext эффективно отправляет limit параметров, так что ваш сервер, который не обрабатывает его ...

Только один совет, но вы должны рассмотреть вопрос о повышении до последней версии Ext, т.к. буферизованный grid seems to have been simplified, и это позволит избежать необходимости его переделывать, если вы в конечном итоге обновите его.