This repository has been archived by the owner. It is now read-only.
Ext JS 5 trigger implementation. Adds a clear icon to textfields and comboboxes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Clear.js
LICENSE
README.md
demo.html
demo.js

README.md

Deprecated: See this example for a better solution

Ext.ux.form.trigger.Clear

Ext JS 5 trigger implementation that adds a clear icon to textfields and comboboxes. A click on this icon clears the value of the field.

See an online demo: http://ralscha.github.io/Ext.ux.form.trigger.Clear

Examples:

  • Add a clear trigger to a textfield that is only visible when the field has a value/text

    { 
      xtype: 'textfield',
      name: 'aSimpleTextField',
      fieldLabel: 'A textfield',
      triggers: {
        clear: {
          type: 'clear'
        }
      }
    }
    
  • Add a clear trigger to a combobox that is always visible

    {
      xtype: 'combobox',
      displayField: 'label',
      valueField: 'value',
      store: store,
      triggers: {
        clear: {
          type: 'clear',
          hideWhenEmpty: false
        }
      }
    }
    
  • Add a clear trigger to a textfield that is only visible when the field has a value and the mouse hovers over the field

    {
      xtype: 'textfield',
      name: 'aSimpleTextField',
      fieldLabel: 'A textfield',
      triggers: {
        clear: {
          type: 'clear',
          hideWhenMouseOut: true
        }
      }
    }
    
  • Clear the value of the field with ESC

    {
      xtype: 'textfield',
      name: 'aSimpleTextField',
      fieldLabel: 'A textfield',
      triggers: {
        clear: {
          type: 'clear',
          clearOnEscape: true
        }
      }
    }