Umbro
Umbro

Reputation: 2204

Modern ExtJS 6 6.2 isValid() is not a function

Can I use the isValid() method in the modern version 6.2 EXTJS as I use it in the classic version?

In the classic version it works, but in the modern version there is error:

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()) {

}

Upvotes: 1

Views: 669

Answers (1)

Rohit Sharma
Rohit Sharma

Reputation: 1410

In modern toolkit, you have to use me.dialog.down('formpanel') instead of me.dialog.down('form')

References:-

1. xtype: 'form' in classic toolkit.

2. xtype: 'formpanel' in modern toolkit.

Hope this will help/guide you.

Upvotes: 1

Related Questions