1. #1
    Sencha User salarmehr's Avatar
    Join Date
    Mar 2010
    Location
    Tehran
    Posts
    45
    Vote Rating
    1
    salarmehr is on a distinguished road

      0  

    Lightbulb Unanswered: *** Plugin files orgnization and namespace ***

    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,684
    Answers
    130
    Vote Rating
    112
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      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
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 salarmehr's Avatar
    Join Date
    Mar 2010
    Location
    Tehran
    Posts
    45
    Vote Rating
    1
    salarmehr is on a distinguished road

      0  

    Default


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

Thread Participants: 2