1
votes

I want to get an infinite scrolling grid with extjs4 and a c# backend... i am setting the proxy api in my controller..

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

});

My Grid:

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

setting proxy in 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
        });

additional information about my view:

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

My grid is still loading all data at once (about 8000 rows...) ... i've searched for solutions and worked through tutorials.. i still dont get it.

please help me out... i dont get it at all...

UPDATE

this is my srv request: enter image description here

and the response got 3MB (about 8k datasets... ) ..??

1
What is your precise version of Ext? This is a feature that has been changing... - rixo
Also, are you sure that your server honors the limit, and start (or page) params? Are they present in the request that is sent by the browser when the store is loaded? - rixo
just updated my post... noob question: how can i see the percise version? - JuHwon
i guess my error is somewhere in my server script.. and i guess its actually not honoring the limits and/or pages.. you think my guess is right ? - JuHwon
about the version.. : i found in the sencha.cfg file the following line: framework.version=4.1.1 - JuHwon

1 Answers

1
votes

Your request dump shows that Ext effectively sends the limit param, so that's your server that is not handling it...

Just a piece of advice, but you should consider upgrading to last version of Ext, since buffered grid seems to have been simplified, and that will avoid you having to rework it if you eventually upgrade.