Jump to content

Unable to use ExtJS plugins


estrify

Recommended Posts

Hi Farshad,

 

I need your wisdom... I am trying to use a ExtJS plugin attached to a form control, but the init function of the plugin never fires (the constructor fires ok)... what I am doing wrong???

 

1. the plugin is in a file, loaded in server module correctly

2. the component is associated with the plugin within its OnBeforeRender client side event

 

Is there any special considerations to keep in mind to use plugins in UniGUI?. It could be a bug?

 

TIA,

 

Link to comment
Share on other sites

  • Administrators

Hi Farshad,

 

I need your wisdom... I am trying to use a ExtJS plugin attached to a form control, but the init function of the plugin never fires (the constructor fires ok)... what I am doing wrong???

 

1. the plugin is in a file, loaded in server module correctly

2. the component is associated with the plugin within its OnBeforeRender client side event

 

Is there any special considerations to keep in mind to use plugins in UniGUI?. It could be a bug?

 

TIA,

 

Can't say anything before seeing you code.

Link to comment
Share on other sites

  • Administrators

http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.AbstractComponent-cfg-plugins

 

 

plugins : Ext.AbstractPlugin[]/Object[]/Ext.enums.Plugin[]2

An array of plugins to be added to this component. Can also be just a single plugin instead of array.

Plugins provide custom functionality for a component. The only requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. When a component is created, if any plugins are available, the component will call the init method on each plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the component as needed to provide its functionality.

Plugins can be added to component by either directly referencing the plugin instance:

By using config object with ptype:

plugins: ['cellediting', 'gridviewdragdrop'],



			
		
  • Upvote 2
Link to comment
Share on other sites

 

plugins must be an array:

 

 

sender.plugins=[ Ext.create('Ext.ux.form.field.MyPlugin', {option:"Value"} ) ];
 

not necessarily, also works 

 sender.plugins=Ext.create('Ext.ux.form.field.MyPlugin');   

alert(sender.plugins[0]);

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...