O'Reilly logo

Ext JS 3.0 Cookbook by Jorge Ramon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading form data from the server

An important part of working with forms is loading the data that a form will display. Here's how to create a sample contact form and populate it with data sent from the server.

Loading form data from the server

How to do it...

  1. Declare the name and company panel:
    var nameAndCompany = { columnWidth: .5,
    layout: 'form',
    items: [
    { xtype: 'textfield',
    fieldLabel: 'First Name',
    name: 'firstName',
    anchor: '95%'
    },
    {
    xtype: 'textfield',
    fieldLabel: 'Last Name',
    name: 'lastName',
    anchor: '95%'
    },
    {
    xtype: 'textfield',
    fieldLabel: 'Company',
    name: 'company',
    anchor: '95%'
    },
    {
    xtype: 'textfield',
    fieldLabel: 'Title',
    name: 'title',
    anchor: '95%'
    }
    ]
    }
    
  2. Declare ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required