(YearSalesTarget ge 1000 and State eq 'nv')
I seem to be getting a memory leak on the grid widget. I pasted my code is below. In Firefox 12, when the application first runs up, Windows Task Manager says it is taking up around 60Mb of memory. If you click the add button, the memory used grows to around 85Mb, When you click the remove button, the memory does reduce a bit (after about 30 secs), but it only reduces to around 80Mb.
Is there leak in my code or kendo grid widget?
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<script src="Scripts/jquery.min.js"></script>
<script src="Scripts/kendo.web.min.js"></script>
<link href="Styles/kendo.common.min.css" rel="stylesheet" />
<link href="Styles/kendo.metro.min.css" rel="stylesheet" />
</head>
<body>
<div>
<button id="add" value="add">add</button>
<button id="remove" value="remove">remove</button>
<div id="grid"></div>
</div>
<script>
$(document).ready(function () {
$("#add").click(function () {
var data = [],
sharableDataSource,
i;
for (i = 0; i < 5000; i = i + 1) {
data.push({ field: "value " + i
});
}
sharableDataSource = new kendo.data.DataSource({ data: data });
$("#grid").kendoGrid({
groupable: false,
scrollable: true,
sortable: true,
pageable: false,
resizable: true,
selectable: "row",
dataSource: sharableDataSource,
columns: [{ field: "field", title: "field" }]
}).data("kendoGrid");
data = null;
sharableDataSource = null;
});
$("#remove").click(function () {
$("#grid").empty();
});
});
</script>
</body>
</html>
<
html
>
<
head
>
<
title
>Test Kendo</
title
>
<!--In the header of your page, paste the following for Kendo styles-->
<
link
href
=
"../js/kendo.common.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"../js/kendo.kendo.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<!--Then paste the following for Kendo scripts -->
<
script
type
=
"text/javascript"
src
=
"jquery-1.2.6.min.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"js/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"grid"
>
</
div
>
<
script
type
=
"text/javascript"
>
$("#grid").kendoGrid({ columns: [{ field: "FirstName", title: "First Name" }, { field: "LastName", title: "Last Name"}], dataSource: { data: [{ FirstName: "Joe", LastName: "Smith" }, { FirstName: "Jane", LastName: "Smith"}]} });
</
script
>
</
body
>
</
html
>