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"}
});