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

[Solved] Grid paging problem

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefano
Top achievements
Rank 1
Stefano asked on 29 Oct 2014, 09:31 AM
Hi,
I can't change pages in my grid. I followed the instructions and I looked for a solution in the forum without success.
When the page is loaded, I can see the grid with the data but I can't see the page numbers below.
No error appears in the console until I press the key to go to the next page. When I click next I get the following error:

Uncaught TypeError: undefined is not a function
kendo.dataviz.min.js:12
dt.extend.success kendo.dataviz.min.js:12
proxy jquery-2.0.3.js:731
n.success kendo.web.min.js:11
fire jquery-2.0.3.js:2913
self.fireWith jquery-2.0.3.js:3025
done jquery-2.0.3.js:7400(anonymous function) 

When I loaded the page it request the followed data to Odata service (see the FirstRequest.txt attachment)
After click the next button the request is in the second attachment, and it seems it forget the filter parameter.

this is my code:

    $(document).ready(function () {
        $('#Messages').kendoGrid({
            dataSource: {

                type: "odata",
                transport: {
                    read: "/Services/PerseoDataService.svc/JobMessages()",
                        dataType: "json"
                    },
                    schema: {
                        data: function (data) {
                            if (data.value) {
                                return data.value;
                            }
                            delete data["odata.metadata"];
                            return [data];
                        },
                        total: function (data) {
                            return data['odata.count'];

                        },
                        model: {
                            fields: {
                                Code : {type: "int"},
                                Date: { type: "date" },
                                Priority: { type: "int" },
                                Severity: { type: "string" },
                                Message: { type: "string" },
                            }
                        }
                    },
                    filter: { field: "JobKey", operator: "eq", value: "@Model.ID" },
                    pageSize: 15,
                    batch: false,
                    serverPaging: true,
                    serverFiltering: true,
                    serverSorting: true,
                    sort: { field: "Priority", dir: "asc" }
                },
                //scrollable: {
                //    virtual: true
                //},
                //height: 350,
                filterable: true,
                sortable: true,
                pageable: true,
                resizable: true,
                groupable: false,
                selectable: "row",
                columns: [
                    { field: "Priority", title: "#", width: 30, filterable: false },
                    { field: "Date", title: "Data", width: 90, template: "#= kendo.toString(Date,'HH:mm:ss') #" }, //
                    { field: "Severity", title: "Liv", width: 90 },
                    { field: "Message", title: "Messaggio", }
                ],
                resize: function() {
                    // user has finished resizing the window
                   // var height = 350;
                   //$(".k-grid-content").height(height);
                }
            });
            $("#details").children().prop('disabled', true);
        });

Thank you

Claudio
            

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Oct 2014, 03:06 PM
Hello Stefano,

I'm afraid that it is not obvious what may be the cause for such behavior looking at the provided details. I have created a test page which tries to recreate the scenario you have described (I just fixed the read method configuration as the dataType option was not correctly set), but unfortunately to no avail. Therefore, it will be appreciated if you could provide a small runnable sample or update the test page as the issue can be observed locally.

Regards,
Rosen
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
Stefano
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or