Book Image

Learning Ext JS_Fourth Edition

Book Image

Learning Ext JS_Fourth Edition

Overview of this book

Table of Contents (22 chapters)
Learning Ext JS Fourth Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Submitting the data


So far, we have seen how to create and configure the components to collect data using the available widgets, but we need to do something with it. Ext JS provides different ways to submit the captured data to our server.

The Ext.form.Panel class contains an instance of the Ext.form.Basic class. This class is used to manage the data within the form, such as validations, settings, retrieving data from the fields, submitting and loading data from the server, and so on.

Let's make some slight changes to our first form:

Ext.define('Myapp.view.CustomerForm02', {
  ...
  initComponent: function() {
    var me = this;
    me.dockedItems= [{
      xtype: 'toolbar',
      dock: 'bottom',
      items: [
        {
          xtype: 'tbfill'
        },{
          xtype: 'button',
          iconCls: 'save-16',
          text: 'Save...',
          handler:function(){  //step one
            this.submitMyForm();
          },
          scope:this
        }
      ]
    }];
    Ext.applyIf(me...