I'm trying to read data from server side and fill in to the grid, it's about 50,000 rows.
I'm using Spring MVC, it always takes 5~9 seconds between "return 'index'" and receiving the "read" request from index.jsp, and it'll take a little shorter after the first loading of grid, but also more than 3 seconds every time.
My controller code is like this: (the time is between time1 and time2)
@RequestMapping(method={RequestMethod.GET})
public String index(Model model) {
// time1
return
"index"
;
}
@RequestMapping(value=
"list"
, method={RequestMethod.GET})
@ResponseBody
public String list(Model model) {
// time2
...
}
The related dataSource code is like:
var
dataSource1 =
new
kendo.data.DataSource({
transport: {
read: { url:
"${listUrl}"
, dataType:
"json"
},
create: { url:
"${createUrl}"
, dataType:
"json"
, type:
"post"
},
update: { url:
"${updateUrl}"
, dataType:
"json"
, type:
"post"
},
parameterMap:
function
(options, operation) {
return
{
category: category,
queryType: queryType.value(),
models: kendo.stringify(options.models)
}
}
},
batch:
true
,
pageSize: 20,
schema: {
model: {
id:
"id"
,
fields: {
id: { type:
"number"
, editable:
false
},
on: { type:
"string"
},
ln: { type:
"string"
, validation: { required:
true
} }
}
}
},
requestEnd: onRequestEnd
});
$(
"#grid1"
).kendoGrid({
dataSource: dataSource1,
pageable:
true
,
height: 550,
toolbar: [
"create"
],
columns:
[{
field:
"id"
, title:
"ID"
, width:
"80px"
,
filterable: {
ui:
function
(element) {
element.kendoAutoComplete({
dataSource: dataSource1,
dataTextField:
"id"
});
}
}
},{
field:
"on"
, title:
"Operating Name"
, width:
"320px"
,
filterable: {
ui:
function
(element) {
element.kendoAutoComplete({
dataSource: dataSource1,
dataTextField:
"on"
});
}
}
},{
field:
"ln"
, title:
"Legal Name"
, width:
"320px"
,
filterable: {
ui:
function
(element) {
element.kendoAutoComplete({
dataSource: dataSource1,
dataTextField:
"ln"
});
}
}
},{
command: [
"edit"
], title:
" "
, width:
"200px"
}],
editable:
"inline"
,
filterable: {
extra:
false
,
operators: {
number: {
eq:
"Is equal to"
,
gt:
"Greater than"
,
},
string: {
startswith:
"Starts with"
,
contains:
"Contains"
,
}
}
},
});
var
dataSource2 =
new
kendo.data.DataSource({
transport: {
read: { url:
"${listUrl}"
, dataType:
"json"
},
create: { url:
"${createUrl}"
, dataType:
"json"
, type:
"post"
},
update: { url:
"${updateUrl}"
, dataType:
"json"
, type:
"post"
},
parameterMap:
function
(options, operation) {
return
{
category: category,
queryType: queryType.value(),
models: kendo.stringify(options.models)
}
}
},
batch:
true
,
pageSize: 20,
schema: {
model: {
id:
"id"
,
fields: {
id: { type:
"number"
, editable:
false
},
desc: { type:
"string"
, validation: { required:
true
} }
}
}
},
requestEnd: onRequestEnd
});
$(
"#grid2"
).kendoGrid({
autoBind:
false
,
dataSource: dataSource2,
pageable:
true
,
height: 550,
toolbar: [
"create"
],
columns:
[{
field:
"id"
, title:
"ID"
, width:
"80px"
,
filterable: {
ui:
function
(element) {
element.kendoAutoComplete({
dataSource: dataSource2,
dataTextField:
"id"
});
}
}
},{
field:
"desc"
, title:
"Description"
, width:
"840px"
,
filterable: {
ui:
function
(element) {
element.kendoAutoComplete({
dataSource: dataSource2,
dataTextField:
"desc"
});
}
}
},
{
command: [
"edit"
], title:
" "
, width:
"200px"
}
],
editable:
"inline"
,
filterable: {
extra:
false
,
operators: {
number: {
eq:
"Is equal to"
,
gt:
"Greater than"
,
},
string: {
startswith:
"Starts with"
,
contains:
"Contains"
,
}
}
},
});
Please help me to find the reason, Thanks!