I have a grid, that works fine, when page gets through address or postback.
But if I load the page with the grid, go somewhere to other page, then return to th grid page through "Back" button in the browser, then the grid will display, populates with data, but all the columns and schema are lost.
It display all the columns (when only 5 of then should be displayed), type in the schema is not applied (date fileds are displayed as /Date12345... format) and no tempate are aplied to the fields where these templates are defined.
Help me please, this ruins my site!
I've tried to read data again with dataSource "read" method - everything the same.
If I press "F5", then grid will display normally.
Here is the code:
$(document).ready(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "Courses.aspx",
contentType: "application/json",
dataType: "json",
cache:false
}
},
schema: {
data: "List",
total: "Total",
model: {
id: "ID",
fields: {
CourseVersionName: {
editable: false,
nullable: true
},
CourseName: {
editable: false,
nullable: true
},
CourseLanguage: {
editable: false,
nullable: true
},
Country: {
editable: false,
nullable: true
},
LastLoad: {
type: "Date",
editable: false,
nullable: true
},
QuestionsCount: {
editable: false,
nullable: true
},
ExpirationDate: {
type: "Date",
editable: false,
nullable: true
}
}
}
},
pageSize: 5,
serverPaging: true
});
$("#dataGrid").kendoGrid({
dataSource: dataSource,
columns: [
{ field: "CourseVersionName", title: "Course Version" },
{ field: "CourseName", title: "Course Name" },
{ field: "CourseLanguage", title: "Language" },
{ field: "Country", title: "Country" },
{ field: "LastLoad", title: "Course Loaded Date", sortable: true, template: '#=kendo.format("{0:dd.MM.yyyy}", LastLoad)#' },
{ field: "QuestionsCount", title: "Questions", template: '<a href="Questions.aspx?CourseID=${ ID }">Questions (${ QuestionsCount })</a>' },
{ field: "ExpirationDate", title: "Expiration Date", sortable: true, template: '#= ExpirationDate != null ? kendo.format("{0:dd.MM.yyyy}", ExpirationDate) : ""#' }
],
autoBind : false,
pageable: true
});
dataSource.read();
But if I load the page with the grid, go somewhere to other page, then return to th grid page through "Back" button in the browser, then the grid will display, populates with data, but all the columns and schema are lost.
It display all the columns (when only 5 of then should be displayed), type in the schema is not applied (date fileds are displayed as /Date12345... format) and no tempate are aplied to the fields where these templates are defined.
Help me please, this ruins my site!
I've tried to read data again with dataSource "read" method - everything the same.
If I press "F5", then grid will display normally.
Here is the code:
$(document).ready(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "Courses.aspx",
contentType: "application/json",
dataType: "json",
cache:false
}
},
schema: {
data: "List",
total: "Total",
model: {
id: "ID",
fields: {
CourseVersionName: {
editable: false,
nullable: true
},
CourseName: {
editable: false,
nullable: true
},
CourseLanguage: {
editable: false,
nullable: true
},
Country: {
editable: false,
nullable: true
},
LastLoad: {
type: "Date",
editable: false,
nullable: true
},
QuestionsCount: {
editable: false,
nullable: true
},
ExpirationDate: {
type: "Date",
editable: false,
nullable: true
}
}
}
},
pageSize: 5,
serverPaging: true
});
$("#dataGrid").kendoGrid({
dataSource: dataSource,
columns: [
{ field: "CourseVersionName", title: "Course Version" },
{ field: "CourseName", title: "Course Name" },
{ field: "CourseLanguage", title: "Language" },
{ field: "Country", title: "Country" },
{ field: "LastLoad", title: "Course Loaded Date", sortable: true, template: '#=kendo.format("{0:dd.MM.yyyy}", LastLoad)#' },
{ field: "QuestionsCount", title: "Questions", template: '<a href="Questions.aspx?CourseID=${ ID }">Questions (${ QuestionsCount })</a>' },
{ field: "ExpirationDate", title: "Expiration Date", sortable: true, template: '#= ExpirationDate != null ? kendo.format("{0:dd.MM.yyyy}", ExpirationDate) : ""#' }
],
autoBind : false,
pageable: true
});
dataSource.read();