我在 extjs 7.2 中有一个网格,其中有一个按日期过滤的商店。我有一个开始日期和一个结束日期,它们绑定到我的 ViewModel 中的日期对象。初始化网格时,第一个字段 (start_date) 的日期显示在字段中,但随后程序从日期字段中引发类型错误。
未捕获的类型错误:j[d] 不是函数
ExtJS 86 getErrors getErrors validateValue isValid validate onChange onChange checkChange setValue setValue setValue setValue onBindNotify notify react notify notify fireItemMutationEvent clip setViewSize onViewResize onViewRefresh pass createSingle fire doFireEvent doFireEvent doFireEvent fireEventArgs fireEvent onBoxReady afterFirstLayout afterFirstLayout afterComponentLayout afterComponentLayout notifyOwner callLayout flushLayouts runComplete k callParent runComplete run flushLayouts resumeLayouts resumeLayouts setActiveTab doActivateTab onClick fire fire publish publishDelegatedDomEvent doDelegatedEvent onDelegatedEvent addDelegatedListener subscribe addListener addListener doAddListener doAddListener addManagedListener addManagedListener a onRender onRender finishRender finishRenderItems finishRender finishRenderChildren afterRender finishRender finishRenderItems finishRender finishRenderChildren finishRenderChildren afterRender finishRender finishRenderItems finishRender finishRenderChildren afterRender finishRender render constructor ctor <anonymous> My Project ext-all.js:20:1539234 ExtJS 55 onDelegatedEvent self-hosted:935 ExtJS 31 <anonymous> My Project
这是带有绑定的网格的 js 类:
Ext.define(K.maintenance.classes.grid, {
extend: K.shared.classes.groupedGrid,
controller: K.maintenance.aliases.controller,
viewModel: K.maintenance.aliases.viewmodel,
requires: ['Ext.data.validator.Date'],
xtype: K.maintenance.xtypes.grid,
bind: '{store}',
tbar: {
xtype:'toolbar',
items: [
{
reference: 'print',
iconCls:'icons-print',
},
'->','Start date : ',
{
xtype: 'datefield',
reference: 'start_date',
vtype: 'daterange',
format: 'Y-m-d',
bind: {
value: '{startDate}',
maxDate: '{endDate}'
},
validators: 'date'
},'-','Stop date : ',
{
xtype: 'datefield',
reference: 'stop_date',
vtype: 'daterange',
format: 'Y-m-d',
bind: {
value: '{endDate}',
minDate: '{startDate}'
},
validators: 'date'
}
]
},
columns: {...}
viewConfig: {
forceFit:true,
scrollToTop: Ext.emptyFn,
scrollOffset: 19,
stripeRows: true
},
stateful: false,
stateId: 'tool_maintenance_status',
animCollapse: false,
});
任何帮助弄清楚为什么会抛出该错误将不胜感激。