• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] Shared Apps Best Practise

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] Shared Apps Best Practise

    Hi,

    Just looking for a bit of guidance re: best practise - when writing shared apps should you still observe the MVC structure or is it ok to put the likes of stores and models inline to a view ?

    Thanks
    Glenn

  • #2
    Depends on the situation of course. I could see it going either way.

    Can you elaborate more on what kind of shared apps?

    Comment


    • #3
      Ok, we have a grid that is fed by a model / store. The grid has controller functionality that we wish to use across multiple apps so the question is do I put the model / store inline to the grid view or should I have a shared model and a shared store ? or does it not matter ?

      Comment


      • #4
        I think using a shared model and store would be preferred.

        Would you use the same controller for all apps?

        Comment


        • #5
          We use a 'base' model/view/controller that 18 grid type apps are built off of.

          Each app dynamically builds it's columns and can have up to 21 tabs.

          A single RPG and PF supply the data to all the apps.

          It's a very simple yet powerful design that has allowed us to add grid apps quickly.

          If you are interested and want to know more, please let me know.

          Thanks...

          Comment


          • #6
            Yes, it will be the same controller.

            The app using the shared app will have a reference in its app.js to the shared controller (see example in red below)...

            Code:
            Ext.application({
                appFolder: '/wms/apps/management/ManageWork/app',
                controllers: [
                    'ChartController',
                    'FilterController',
                    'GridController',
                    'WMS.shared.controller.FilterController'
                    'WMS.shared.controller.instruction.Assign'
                ],
            The shared app will be self contained (see example below)...

            Code:
            Ext.define('WMS.shared.controller.instruction.Assign', {
                extend: 'WMS.base.Controller',
                requires: [
                   'WMS.shared.view.AssignInstructions'
                ],
            
            
                init: function() {
            
            
                    this.control({structions button': {
                        'assigninstructions #confirmAssign': {
                            click: this.onItemClick
                        }
                    });
            
            
                },
            
            
                onItemClick: function(){
                    console.log('Item Clicked');
                },
            
            
                onLaunch: function() {
            
            
                    return Ext.create('WMS.shared.view.AssignInstructions')
            
            
                }
            
            
            });

            Comment

            Working...
            X