Clear Up
SharpKit Reference

Text Class

Namespace: Ext.field

Base Types

System.Object

Constructors

Name Description
Text(TextConfig)
Text()

Properties

Name Description
alias The text field is the basis for most of the input fields in Sencha Touch. It provides a baseline of shared functionality such as input validation, standard events, state management and look and feel. Typically we create text fields inside a form, like this: * Ext.create('Ext.form.Panel', { tbar: { text: 'Enter your name' }, * items: [ { xtype: 'textfield', label: 'First Name', name: 'firstName' }, { xtype: 'textfield', label: 'Last Name', name: 'lastName' } ] }); * This creates two text fields inside a form. Text Fields can also be created outside of a Form, like this: * Ext.create('Ext.field.Text', { label: 'Your Name', value: 'Ed Spencer' }); * ## Configuring * Text field offers several configuration options, including {@link #placeHolder}, {@link #maxLength}, {@link #autoComplete}, {@link #autoCapitalize} and {@link #autoCorrect}. For example, here is how we would configure a text field to have a maximum length of 10 characters, with placeholder text that disappears when the field is focused: * Ext.create('Ext.field.Text', { label: 'Username', maxLength: 10, placeHolder: 'Enter your username' }); * The autoComplete, autoCapitalize and autoCorrect configs simply set those attributes on the text field and allow the native browser to provide those capabilities. For example, to enable auto complete and auto correct, simply configure your text field like this: * Ext.create('Ext.field.Text', { label: 'Username', autoComplete: true, autoCorrect: true }); * These configurations will be picked up by the native browser, which will enable the options at the OS level. * Text field inherits from {@link Ext.field.Field}, which is the base class for all fields in Sencha Touch and provides a lot of shared functionality for all fields, including setting values, clearing and basic validation. See the {@link Ext.field.Field} documentation to see how to leverage its capabilities.
alternateClassName
extend The text field is the basis for most of the input fields in Sencha Touch. It provides a baseline of shared functionality such as input validation, standard events, state management and look and feel. Typically we create text fields inside a form, like this: * Ext.create('Ext.form.Panel', { tbar: { text: 'Enter your name' }, * items: [ { xtype: 'textfield', label: 'First Name', name: 'firstName' }, { xtype: 'textfield', label: 'Last Name', name: 'lastName' } ] }); * This creates two text fields inside a form. Text Fields can also be created outside of a Form, like this: * Ext.create('Ext.field.Text', { label: 'Your Name', value: 'Ed Spencer' }); * ## Configuring * Text field offers several configuration options, including {@link #placeHolder}, {@link #maxLength}, {@link #autoComplete}, {@link #autoCapitalize} and {@link #autoCorrect}. For example, here is how we would configure a text field to have a maximum length of 10 characters, with placeholder text that disappears when the field is focused: * Ext.create('Ext.field.Text', { label: 'Username', maxLength: 10, placeHolder: 'Enter your username' }); * The autoComplete, autoCapitalize and autoCorrect configs simply set those attributes on the text field and allow the native browser to provide those capabilities. For example, to enable auto complete and auto correct, simply configure your text field like this: * Ext.create('Ext.field.Text', { label: 'Username', autoComplete: true, autoCorrect: true }); * These configurations will be picked up by the native browser, which will enable the options at the OS level. * Text field inherits from {@link Ext.field.Field}, which is the base class for all fields in Sencha Touch and provides a lot of shared functionality for all fields, including setting values, clearing and basic validation. See the {@link Ext.field.Field} documentation to see how to leverage its capabilities.

Methods

Name Description
blur() Attempts to forcefully blur input focus for the field. @return {Ext.field.Text} This field
doKeyUp(object) Called when a key has been pressed in the {@link #input} @private
doSetDisabled(object)
focus() Attempts to set the field as the active input focus. @return {Ext.field.Text} This field
hideClearIcon()
initialize()
onClearIconTap()
reset()
showClearIcon()
updateAutoCapitalize(object)
updateAutoComplete(object)
updateAutoCorrect(object)
updateMaxLength(object)
updatePlaceHolder(object)
updateValue(object)
© Copyright 2005-2011 SharpKit. All rights reserved.