我想提供一个带有初步过滤模型的马塔基纳数据网,因此只显示即将到来的日期。 (在用户清除缺损装置过滤器之前)
I have no problems creating a filter for the date after the datagrid is loaded without any initialState set. manually setting filters after rendered datagrid
<
initialState = {{
filter: {
filterModel:{
items: [{
columnField: class_end_date ,
operatorValue: onOrAfter ,
value: new Date()
}],
}
}
}}
I continually get Uncaught TypeError: filterItem.value.match is not a function top of the stacktrace
buildApplyFilterFn gridDateOperators.js:10
getApplyFilterFn gridDateOperators.js:62
https://i.stack.imgur.com/xenod9.png”rel=“nofollow noreferer”> 缺损过滤模型产生的误差
I am assuming there s some kind of type conversion I need for the value property in the items filter object. Still researching, but I can t find anything helpful in MUI docs hence far. If anyone has tackled this one I d be grateful for a step in the right direction! Thank you.
我还确保了我的类型和价值 在我的栏目阵列中适当界定了光。 摘录
{
field: class_start_date ,
headerName: Start Date ,
width: 140,
type: date ,
valueGetter: (params) => {
return new Date(params.value)
}
},
{
field: class_end_date ,
headerName: End Date ,
width: 140,
type: date ,
valueGetter: (params) => {
return new Date(params.value)
}
},
I ve also tried using dateTime for the column type, formatting the dates from the valueGetters and the filtermodel value to mm/dd/yyyy format, and I tried ensuring the value property was a string
filterModel:{
items: [{
columnField: class_end_date ,
operatorValue: onOrAfter ,
value: `${new Date()}`
}],
}