I'd like to configure my toolbar which I have defined in a grid define:
Code:
var grid = Ext.define('Writer.Grid', {
extend: 'Ext.grid.Panel',
alias: 'widget.writergrid',
initComponent: function() {
Ext.apply(this, {
...
tbar: ['->', {
text: 'Print',
iconCls: 'icon-print',
handler : function(){
Ext.ux.grid.Printer.printAutomatically = true;
Ext.ux.grid.Printer.print(Ext.ComponentQuery.query('writergrid[itemId=grid]')[1]);
}
}]
});
}
}
from the container create config when creating the container which holds the grid:
Code:
var main = Ext.create('Ext.container.Container', {
renderTo: Ext.Element.get('invoice-summary'),
layout: 'fit',
height: 400,
autoHeight: true,
items: [{
itemId: 'grid',
xtype: 'writergrid',
flex: 1,
store: store
}]
});