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 Unanswered: *** 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,748
    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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1288
      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
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  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
  •