estrify Posted April 22, 2013 Share Posted April 22, 2013 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 More sharing options...
Administrators Farshad Mohajeri Posted April 22, 2013 Administrators Share Posted April 22, 2013 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 More sharing options...
estrify Posted April 23, 2013 Author Share Posted April 23, 2013 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 Link to comment Share on other sites More sharing options...
stas Posted April 23, 2013 Share Posted April 23, 2013 function OnBeforeInit(sender) { sender.plugins=Ext.create('Ext.ux.form.field.MyPlugin'); } 1 Link to comment Share on other sites More sharing options...
estrify Posted April 23, 2013 Author Share Posted April 23, 2013 function OnBeforeInit(sender) { sender.plugins=Ext.create('Ext.ux.form.field.MyPlugin'); } There are very good people in this forum ... Thank you very much ... Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 23, 2013 Administrators Share Posted April 23, 2013 plugins must be an array: sender.plugins=[ Ext.create('Ext.ux.form.field.MyPlugin', {option:"Value"} ) ]; Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 23, 2013 Administrators Share Posted April 23, 2013 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'], 2 Link to comment Share on other sites More sharing options...
estrify Posted April 23, 2013 Author Share Posted April 23, 2013 http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.AbstractComponent-cfg-plugins Thanks again... Link to comment Share on other sites More sharing options...
stas Posted April 23, 2013 Share Posted April 23, 2013 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now