PDA

View Full Version : Plugin Issue



naveen.kumar
22 May 2012, 3:15 AM
I had made one plugin for Toolbar.I want to make it more genric.Can some can explain?

Here is the code

ToolBarPlugin = function()
{
this.init = function(buttonGroup) {
var toolbarSeprator = Ext.extend(Ext.toolbar.Separator,{
border : 1,
cls : 'seprator'
});

var toolbarButton = Ext.extend(Ext.button.Button,{
overCls : 'blank',
listeners : {
mouseover: function() {
this.setIconCls(this.iconCls+'-hover');
},
mouseout: function() {
this.setIconCls(this.iconCls.substring(0,this.iconCls.lastIndexOf("-")));
}
}
});


var toolgroup=new Ext.create('Ext.container.ButtonGroup', {
bodyBorder : false,
border : false,
renderTo : 'header',
items: [
new toolbarButton({iconCls:'chat'}),
new toolbarSeprator(),
new toolbarButton({iconCls:'copy'}),
new toolbarSeprator(),
new toolbarButton({iconCls:'bookmark'}),
new toolbarSeprator(),
new toolbarButton({iconCls:'cut'}),
new toolbarSeprator(),
new toolbarButton({iconCls:'plus'}),
]
});

};
};


i want to use this plugin in ten places in a page.Please provide that kind of solution and also give me some links where plugin are discussed in details from starting point.

Thanks

scottmartin
23 May 2012, 7:51 AM
I was looking for a online tutorial for our plugin system, but it escapes me.

Here is a good article in creating a plugin for the toolbar that may be of help:
http://loianegroner.com/2011/09/extjs-4-plugin-pagingtoolbarresizer/

There is is a github under the download title for Ext4

Regards,
Scott.