[英]Date Issue in Kendo UI when Filter Grid
當我們過濾Kendo datagrid時,請使用不同類型的運算符,例如eq和,或gt,lt等,這些運算符在字符串和數字上都可以很好地工作。 當我們使用日期來匹配另一個日期時,使用eq運算符不起作用,但是gt,lt起作用。
這是我的源代碼
dataSource: {
data: data,
schema: {
model: {
fields: {
date: { type: "date"},
id: { type: "string" },
name: { type: "number" },
account: { type: "number" }
}
}
},
sort: [ { field: "date", dir: "desc" }],
filter : [{
field: "date", operator: "eq", value: dateString
}],
pageSize: 30,
}
可能未讀取您的日期字符串具有日期,因此當它進行過濾時會引發錯誤。
嘗試或使用網格中的格式屬性
columns : [
{
field : "Date",
title : "Date",
format : "{0:dd-MMM-yyyy}",
filterable: {
ui: "datepicker"
}
}
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.