mirror of
https://github.com/ralscha/Ext.ux.form.trigger.Clear.git
synced 2026-10-09 08:18:28 +02:00
Ext JS 5 trigger implementation. Adds a clear icon to textfields and comboboxes
- JavaScript 96.1%
- HTML 3.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| Clear.js | ||
| demo.html | ||
| demo.js | ||
| LICENSE | ||
| 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 } } }