This is a migrated thread and some comments may be shown as answers.

Disable multiple ajax requests sent by Kendo Grid

1 Answer 448 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Niloofar
Top achievements
Rank 1
Niloofar asked on 29 Mar 2016, 03:02 PM
As its shown below, i'm overriding my read function in transport to send ajax request to get data and set it as datasource for the grid but i also have server side paging enabled with virtual scrolling. But i have noticed that i see instead of one, multiple requests(at least two) were sent. I read the posts and people are talking about prefetch and fetch issue. Is there any good solution sofar to fix this issue in my case.
 
var dataSource = {
    transport: {
        read: function (options) {
            var success = function (response) {
                options.success(response);
            };
 
            var error = function (xhr, status, error) {
                Ember.Logger.error('Fail response: ' + xhr.responseText + ' (status=' + xhr.status + ' ' + error + ')');
            };
            _this.get('PopulateGridData')(gridUrl, success, error, options.data, 'POST', true, true);
        },
    },
    pageSize: gridPageSize,
    schema: gridSchema,
    serverPaging: true,
    serverSorting: true,
    serverGrouping: true,
    serverFiltering: true,
};
 
var gridOptions = {
    dataSource: dataSource,
    columns: gridColumns,
    editable: gridEditable,
    pageable: {
        refresh: true,
        numeric: false,
        previousNext: false,
    },
    height: gridHeight,
    scrollable: {
        virtual: true,
    },
    groupable: true,
    filterable: true,            
};
 
var grid = Ember.$("#kendo-grid").kendoGrid(gridOptions).data('kendoGrid');
 
_this.set('kendoGrid', grid);

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 01 Apr 2016, 06:30 AM

Hello Niloofar,

 

As it seems you've already have found the information about how virtualization works, i.e it pre-fetches data in order to achieve more smooth scrolling experience. You could not disable these request as they are integral part of the implementation.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Niloofar
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or