Ext JS 5 trigger implementation. Adds a clear icon to textfields and comboboxes
  • JavaScript 96.1%
  • HTML 3.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2017-12-03 11:34:42 +01:00
.gitignore Initial commit 2014-08-15 09:09:39 +02:00
Clear.js Add myself :-) 2014-08-19 13:53:43 +02:00
demo.html Initial commit 2014-08-15 09:09:39 +02:00
demo.js Add link to project 2014-08-16 11:49:38 +02:00
LICENSE Convert line ending 2015-07-05 21:37:33 +02:00
README.md Update README.md 2017-12-03 11:34:42 +01:00

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
        }
      }
    }