gpt4 book ai didi

javascript - 现代 ExtJS 6 6.2 isValid() 不是函数

转载 作者:行者123 更新时间:2023-11-30 20:21:06 25 4
gpt4 key购买 nike

isValid() 方法在 modern version 6.2 EXTJS 中是否可以像在经典版本中那样使用?

在经典版本中可以,但在现代版本中会出现错误:

form.isValid() is not a function

FeedForm.js

Ext.define('FeedViewer.view.main.FeedForm', {
extend: 'Ext.form.Panel',
xtype: 'feedform',

requires: [
'Ext.Button',
'Ext.field.Select',
'Ext.form.FieldSet',
'Ext.Toolbar'
],

title: 'New RSS Feed',

items: [{
xtype: 'fieldset',
items: [{
xtype: 'selectfield',
label: 'Select a new feed',
labelAlign: 'top',
allowBlank: false,
name: 'feedUrl',
options: [{
value: 'http://rssfeeds.usatoday.com/usatoday-NewsTopStories',
text: 'USA Today Top Stories'
}, {
value: 'http://sports.espn.go.com/espn/rss/news',
text: 'ESPN Top News'
}]
}]
}, {
xtype: 'toolbar',
docked: 'bottom',
items: [{
xtype: 'button',
reference: 'savebutton',
action: 'save',
ui: 'action',
text: 'Add'
}]
}]
});

MainController.js

var form = me.dialog.down('form');

if (form.isValid()) {

}

最佳答案

modern 工具包中,您必须使用 me.dialog.down('formpanel') 而不是 me.dialog .down('表格')

引用资料:-

1. xtype: 'form'classic 工具包中。

2. xtype: 'formpanel'modern 工具包中。

希望这对您有所帮助/指导。

关于javascript - 现代 ExtJS 6 6.2 isValid() 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51441995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com