Extjs Plugins ~upd~ 💯
addClearButton: function() this.clearBtn = this.field.addButton( cls: 'x-clear-button', iconCls: 'x-fa fa-times-circle', hidden: this.field.isEmpty(), handler: this.clearField.bind(this) ); this.field.on('change', this.updateButtonVisibility, this); ,
toggleRow: function(view, rowIdx, colIdx, item, e, record) var row = view.getRow(rowIdx); if (row && row.nextSibling && row.nextSibling.classList.contains('x-row-expander-detail')) Ext.fly(row.nextSibling).destroy(); else this.showDetail(row, record); , extjs plugins
updateButtonVisibility: function(field, newVal) this.clearBtn.setVisible(!Ext.isEmpty(newVal)); addClearButton: function() this
onBeforeSubmit: function(form, action) if (action.type === 'submit') var errors = this.validate(); if (errors.length) this.fireEvent('validationfailed', this, errors); return false; // cancel submit this.fireEvent('validationsuccess', this); return true; , iconCls: 'x-fa fa-times-circle'
onItemDblClick: function(view, record, item, index, e) this.toggleRow(view, index, null, null, e, record);
); Ext.define('MyApp.plugin.Validator', extend: 'Ext.plugin.Abstract', alias: 'plugin.validator', config: rules: null ,
onHostDestroy: function() console.log('Component destroyed:', this.host.getId());