Jump to content

Recommended Posts

Posted

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,

 

  • Administrators
Posted

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.

Posted

Hi,

Here is a test case... You can see normal functionality opening html_sample\MyPlugin.html  (simply one alert in constructor and another one in init).

With UniGUI, only costructor alert is shown so the plugin doesn't run.  What detail I'm overlooking?

TIA

20130423_plugin.rar

Posted

 

function OnBeforeInit(sender)
{
    sender.plugins=Ext.create('Ext.ux.form.field.MyPlugin');   
}

There are very good people in this forum ... Thank you very much ...

  • Administrators
Posted

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
Posted

 

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]);

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...