Results 1 to 4 of 4

Thread: *** Plugin files orgnization and namespace ***

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Location
    Tehran
    Posts
    46
    Vote Rating
    1
      0  

    Lightbulb *** Plugin files orgnization and namespace ***

    I ask from all plugin and extension developers to use the following namespace pattern to isolate their plugins, so plugin changing and updating will be more easy and Ext.Loader will work perfectly: (please note to caseing)
    Ext.ux.pluginName.PluginName (Master / bootstarp ns)
    js/ux/pluginName/PluginName.js (Master file)

    Ext.ux.pluginName.PluginName.form.field.Xxxx (example of other ns)
    js/ux/pluginName/form/field/Xxxx.js (Other file)

    Ext.ux.pluginName.PluginName.grid.feature.Yyy (example of other ns)
    js/ux/pluginName/grid/feature/Yyyy.js (Other file)
    File orgnization:

    public
    .......|-app
    .......|-js
    ..............|-ext
    ..............|-ux
    .....................|- {plugin-name}
    ............................|- css
    ............................|- img
    ............................|- *.js

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130
    Vote Rating
    128
      0  

    Default

    since i guess app is the part of an ext mvc app, all included files and folders should only contain js. so why using a folder js on the same level?
    Best regards
    Tobias Uhlig

  3. #3
    Sencha - Community Support Team mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,020
    Answers
    3976
    Vote Rating
    1363
      0  

    Default

    In your path, you would need to do something like this:

    Code:
    Ext.Loader.setPath({
        'Ext.ux' : '/js/ux'
    });
    Since you want a folder with the plugin-name, your actual class will need to be:

    Ext.ux.MyPluginName.MyPluginName
    and have your MyPluginName.js in this folder:

    /js/ux/MyPluginName/MyPluginName.js
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Location
    Tehran
    Posts
    46
    Vote Rating
    1
      0  

    Default

    @tobiu I think it is a good practice to separate 3rd party file from project-specific files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •