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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...