Results 1 to 4 of 4

Thread: Need to customize a couple of views - is Ext.app.Profile the right tool?

  1. #1
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    729
    Vote Rating
    81
      0  

    Default Need to customize a couple of views - is Ext.app.Profile the right tool?

    Need some insight here before I venture too far down the wrong way.
    I have a Ext 6.7 modern app, designed for desktop. For a new customer I need to swap a couple of views and controllers and I have been think about the best solution.
    I have looked at the "runtime" profiles (implemented using Ext.app.Profile) that seems to be what I want. As a proof of concept I have got it to work as I want; swapping out viewcontrollers and views and event getting everything to compile.
    My question related to a couple of warning while developing, for example:
    Code:
    [W] Overriding existing mapping: 'controller.installation' From 'CopcalcApp.desktop.src.mitsu.view.installation.InstallationController' to 'CopcalcApp.desktop.src.view.installation.InstallationController'. Is this intentional?
    [W] Overriding existing mapping: 'controller.installation' From 'CopcalcApp.desktop.src.view.installation.InstallationController' to 'CopcalcApp.desktop.src.mitsu.view.installation.InstallationController'. Is this intentional?
    For the views I get away by not adding any xtype to the different views and let the profile be responsible for this (throwing PHPStorm IDE off since it cannot find any xtype, but that is minor):
    Code:
    Ext.define('CopcalcApp.profile.Tangix', {
    
        extend: 'Ext.app.Profile',
    
    views: {
            'installation-top': 'CopcalcApp.desktop.src.view.installation.Installation'
    },
    
    isActive: function () {
            var s = location.search;
    
            if (s.match(/\bmitsu\b/) || (Settings.config.code == 'tgix')) {
                return true;
    } else {
                return false;
    }
    
        },
    
    launch: function() {
            Ext.log('Launch Tangix profile');
    }
    
    });
    How do I do the same thing for controllers and viewmodels? Tried adding a controllers block to the profile but the alias doesn't seem to stick.

    Anyone been using profiles that could point me in the right direction?

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,237
    Vote Rating
    1015
      0  

    Default

    The controllers/viewmodels should be included by the views themselves, so you shouldn't need to include that at that level.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    729
    Vote Rating
    81
      0  

    Default

    Ah - gotcha. Will try, thanks!

  4. #4
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    729
    Vote Rating
    81
      0  

    Default

    Got it working! Many thanks.

Posting Permissions

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