Hi,
I'm playing with the excellent Ext.ux.grid.Search Plugin by Saki and I would like to know about the best way of integrating it into a GUI built with Ext Direct. The tools is generating a set of files (stores, user interface, etc.). My base file is called 'homeContainer.ui.js' (I never touch this one) and I usually add extra methods, listeners, etc into the 'homeContainer.js' file.
I am now trying to integrate the search box but I don't know exactly how to proceed. The element where I want to add the search box is a Grid (xtype : 'grid'). If I add the JSON code straight into the grid structure in 'homeContainer.ui.js', everything works fine, like this:
Code:
plugins:[new Ext.ux.grid.Search({
iconCls:'icon-zoom'
,align: 'right'
,width: 150
,readonlyIndexes:['note']
,disableIndexes:['pctChange']
,minChars:2
,autoFocus:true
})],
But I do not want to touch 'homeContainer.ui.js'. I've been trying to add it through the ''homeContainer.js' but didn't manage to make it work:
Code:
homeContainer = Ext.extend(homeContainerUi, {
initComponent: function() {
homeContainer.superclass.initComponent.call(this);
mygrid = Ext.getCmp('MyGrid');
mygrid.plugins = new Ext.ux.grid.Search({
iconCls:'icon-zoom'
,readonlyIndexes:['note']
,disableIndexes:['pctChange']
,minChars:2
,autoFocus:true
});
I've also tried creating a JSON array as follows:
Code:
item = {plugins: new Ext.ux.grid.Search({
iconCls:'icon-zoom'
,readonlyIndexes:['note']
,disableIndexes:['pctChange']
,minChars:2
,autoFocus:true
})}
mygrid.add(item);
But didn't work either. Any suggestions? Many thanks in advance