Extjs Plugins [patched] Site

destroy: function() if (this.host) this.host.un('someevent', this.handler, this); delete this.host; this.callParent();

init: function(host) this.host = host; // Add event listeners if (this.getLogEvents()) host.on( afterrender: this.onHostRender, destroy: this.onHostDestroy, scope: this ); , extjs plugins

clearField: function() this.field.setValue(''); this.field.focus(); , destroy: function() if (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); , In ExtJS, a Plugin is a class that

Better: use mon (monitor) to safely override. Example 1: Row Expander Plugin (Custom Version) Ext.define('MyApp.plugin.RowExpander', extend: 'Ext.plugin.Abstract', alias: 'plugin.rowexpander', config: expandOnDblClick: true ,

init: function(grid) this.grid = grid; grid.addCls('grid-with-expander'); // Add a new column for expand/collapse grid.reconfigure(grid.getStore(), [ xtype: 'actioncolumn', width: 30, items: [ iconCls: 'x-fa fa-plus', handler: this.toggleRow.bind(this) ] ].concat(grid.getColumns())); if (this.getExpandOnDblClick()) grid.on('itemdblclick', this.onItemDblClick, this); ,

1. What is an ExtJS Plugin? In ExtJS, a Plugin is a class that encapsulates reusable functionality, which can be dynamically added to a component (like a Grid, Form, or Panel) at runtime or design time. Unlike a component's subclass (e.g., Ext.grid.Panel ), a plugin does not inherit from the host component. Instead, it "plugs into" the component's lifecycle and event system to augment its behavior.