2013-06-04 90 views
1

我想用extjs4和C#后端的无限滚动网格...我设置代理API在我的控制器..ExtJS的4.1无限电网滚动不工作

我的模型:

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'} 
    ] 

}); 

我的网格:在controoler

{ 
    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' }, 
} 

设置代理:

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

什么是您的精确版本的分机?这个功能一直在改变...... – rixo

+1

另外,你确定你的服务器是否支持'limit'和'start'(或'page')参数?它们是否存在于加载商店时由浏览器发送的请求中? – rixo

+0

刚刚更新了我的帖子... noob问题:我怎么能看到pericise版本? – JuHwon

回答

1

您的请求信息显示表明分机有效地发送limit PARAM,所以这是您的服务器不处理它...

只是一个忠告,但你应该考虑升级到内线的最后一个版本,因为缓冲grid seems to have been simplified,这样可以避免在最终升级时不得不重新使用它。