Grid custom read function paging options null

4 posts, 0 answers
  1. Jason
    Jason avatar
    12 posts
    Member since:
    Oct 2014

    Posted 18 Mar 2015 Link to this post

    I am trying to do my own custom paging on the server but on initial load by calling grid.datasource.read() the options.data.skip and take  parameters are null

    $scope.searchGridOptions = {
                dataSource: new kendo.data.DataSource({
                    type: "ajax",
                    transport: {
                        read: function (options) {
                            $scope.FilterMeta.QueryFilterSearchViewModel.StartIndex = options.data.skip ? options.data.skip : 0;
                            $scope.FilterMeta.QueryFilterSearchViewModel.DisplayLength = options.data.take ? options.data.take : 10;
                            var js = JSON.stringify(createSearchRequestData($scope.FilterMeta));
                            //e.data.push({ queryFilterSearchViewItem: js })
                            $.ajax({ method: 'POST', url: 'http://localhost:6661/api/Schools/GetEntitiesForSearch', data: { queryFilterSearchViewItem: js } })
                                .success(function (data) {
                                    return options.success(data);
                                }).error(function (error) {
                                    options.error(error);
                                });
     
                        }
                    },
                    schema: {
                        data: function (data) {
                            return data.Results;
                        }, // records are returned in the "data" field of the response
                        total: function (data) {
                            return data.TotalEntityCount;
                        }
                    },
                    serverFiltering: true,
                    serverSorting: true,
                    pagesize: 10,
                    serverPaging: true
                }),
                error: function (e) {
                    if (e.errors) {
                        alert(e.errors);
                    }
                },
                sortable: true,
                pageable: true,
                scrollable: false,
                autoBind: false,
                columns: $scope.searchGridColumns
            };
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 20 Mar 2015 Link to this post

    Hello Jason,

    The ajax type that you are trying to use is not a built-in one and we are not aware of it. For the initial request you should get the initial page parameters page, and take. Here is an example:

    http://dojo.telerik.com/@pesho/Osira

    Could you please point us what exactly is your case and if possible demonstrate it through a small sample.

    Thank you for the cooperation.

    Kind Regards,
    Petur Subev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Mariappan
    Mariappan avatar
    3 posts
    Member since:
    Sep 2014

    Posted 15 Feb 2016 in reply to Petur Subev Link to this post

    hi,

    I'm also facing the same problem.

    When i'm running my application in IE11 i'm facing this issue. I've kept the 'alert('the parameters are :' + JSON.stringify(options.data))' and verified. Below is the output of that alert.

    the parameters are :{"take":"0","skip":null,"page":null,"pageSize":"0"}

    But when i run the same application on IE9, every thing is working fine as expected. skip: 0 and page:1

     

    Can you kindly help us out - whether the issue is because of IE11??

  4. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 18 Feb 2016 Link to this post

    Hello Mariappan,

    Could you please provide a bit more details about the implementation of the transport as well as the DataSource configuration and usage. A small runnable sample demonstrating the issue will be appreciated.

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top