Results 1 to 3 of 3

Thread: [Ext.createByAlias] Unrecognized alias: layout.center

  1. #1

    Default [Ext.createByAlias] Unrecognized alias: layout.center

    I have a simple Login form running on Ext JS 6.6, classic toolkit

    If I set my layout as follow works fine

    layout:'center'

    layout : 'center'

    But if use the following

    platformConfig: {
    '!phone': {
    layout : 'center'
    }
    },



    I get "Unrecognized alias: layout.center"

    at Ext.Inventory.instantiateByAlias (app.js?_dc=1535656825909:7181)
    at Ext.Factory.create (app.js?_dc=1535656825909:10748)
    at Function.fn [as layout] (app.js?_dc=1535656825909:10851)
    at constructor.setLayout (app.js?_dc=1535656825909:46035)
    at constructor.getLayout (app.js?_dc=1535656825909:45788)
    at constructor.initComponent (app.js?_dc=1535656825909:45823)
    at constructor.callParent (app.js?_dc=1535656825909:6139)
    at constructor.initComponent (app.js?_dc=1535656825909:53140)
    at constructor (app.js?_dc=1535656825909:29178)
    at new constructor (app.js?_dc=1535656825909:6462)


    To fix the problem I have to add Ext.layout.container.Center to "requires" but doing so makes my form incompatible with modern toolkit because the class is named Ext.layout.Center

    Why the alias is not found only when I use it inside platformConfig?

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,005

    Default

    We are working on getting you an answer. Thanks for your patience!

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    While support attempts to come back with help, let’s move forward. platformConfig is a runtime config and this won’t help during build time. For a universal application, since there are differences in APIs you would need to create separate views for the different toolkit’s as was the prescribed way to work with the different views APIs. There are other alternatives that may help like getting the class names for the layout in sync yourself but you may find yourself doing this in other places and I don’t think it’d scale very well since in other places cknfigs and such may be different.
    Mitchell Simoens @LikelyMitch

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

    Posts are my own, not any current, past or future employer's.

Similar Threads

  1. Replies: 2
    Last Post: 18 Apr 2018, 12:44 AM
  2. Replies: 2
    Last Post: 5 Sep 2016, 10:26 AM
  3. Replies: 2
    Last Post: 23 Jun 2014, 7:17 PM
  4. Replies: 1
    Last Post: 2 May 2014, 5:40 AM

Tags for this Thread

Posting Permissions

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