Extjs Plugins Hot! -

init: function(host) console.log('Plugin init on', host.$className); this.host = host; // ... rest

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

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; , init: function(host) console

showDetail: function(row, record) var detailDiv = Ext.DomHelper.append(row.parentNode, tag: 'div', cls: 'x-row-expander-detail', html: '<div class="detail-content">Details for ' + record.get('name') + '</div>' , true); detailDiv.setWidth(row.offsetWidth); , init: function(host) console.log('Plugin init on'

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); ,

clearField: function() this.field.setValue(''); this.field.focus(); ,