16
尝试从本地数据源设置我的kendo UI网格上的默认排序列。我读过遍,我应该把:Kendo UI网格本地数据源列默认排序
sort: { field: "price", dir: "desc" }
到数据源。我试过这个,但它仍然不起作用(参见下面的例子)。
这里是我的代码完整,我哪里错了?
$('#grid').kendoGrid({
dataSource: [
{
date: "Feb 13 2014",
price: 5,
},
{
date: "Feb 15 2014",
price: 7,
},
{
date: "Feb 12 2014",
price: 6,
}
],
height:500,
sortable: true,
pageable: false,
columns: [
{
field: "date",
title: "Date"
},
{
field: "price",
title: "Price",
}
],
sort: {field: "price", dir: "desc"}
});