Results 1 to 6 of 6

Thread: layouts.

  1. #1
    Sencha User
    Join Date
    Sep 2017
    Posts
    2

    Default layouts.

    Hey guys,

    I'm stuck trying to specify layout props to a container. Even example fails:
    Code:
    import React, { Component } from 'react';import { Container, Panel } from '@extjs/ext-react';
    
    export default class FitLayoutExample extends Component {
    
      render() {
        return (
          <Container
    layout={{
              type: "hbox",
    align: "middle"
    }}
          >
            <Panel
    html="hello"
    flex={1}
              bodyStyle={{
                background: "#000",
    color: "#fff"
    }}
            />
            <Panel
    html="world"
    flex={2}
              bodyStyle={{
                background: "#f00",
    color: "#fff"
    }}
            />
          </Container>
    )
      }
    
    }
    fails with:
    Code:
    ext.js:10695 Uncaught (in promise) Error: [Ext.createByAlias] Unrecognized alias: layout.hbox    at Ext.Inventory.instantiateByAlias (ext.js:10695)
        at Ext.Factory.create (ext.js:14256)
        at Function.fn [as layout] (ext.js:14359)
        at constructor.applyLayout (ext.js:39309)
        at constructor.setter [as setLayout] (ext.js:8808)
        at Ext.Configurator.configure (ext.js:9087)
        at constructor.initConfig (ext.js:9687)
        at constructor (ext.js:13024)
        at constructor (ext.js:23554)
        at constructor.callParent (ext.js:9662)

  2. #2
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114

    Default

    Adding Ext.require('layout.hbox') to the top of your file should fix this.

  3. #3
    Sencha User
    Join Date
    Sep 2017
    Posts
    2

    Default

    Thanks, Mark.
    But when i add it, it tries to load http://localhost:3002/layout/hbox.js?_dc=1505758184780 and still fails as soon as there is ain't one.

    Isn't it supposed to be in ext.js generated by sencha.cmd?


  4. #4
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114

    Default

    Hmm... maybe you need the full class name?

    Try:

    Code:
    Ext.require('Ext.layout.HBox')

  5. #5
    Sencha User
    Join Date
    Sep 2017
    Posts
    2

    Default

    now it tries to load http://localhost:3002/Ext/layout/HBox.js?_dc=1505864292815

  6. #6
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114

    Default

    Ok, there must be something else going wrong. Can you post the source code for that file?

Similar Threads

  1. Need help with layouts
    By suryanarendra in forum Ext: Q&A
    Replies: 2
    Last Post: 25 Jun 2012, 11:51 AM
  2. Creating absolute positioned layouts or other complex layouts
    By Ayame in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 23 Sep 2011, 1:41 AM
  3. Help with Layouts, Part 2 - how "height in ems" fits into layouts in extjs?
    By Eric.Sencha in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 17 Sep 2010, 9:38 AM
  4. tab layouts
    By piston in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 29 Sep 2008, 9:31 AM

Posting Permissions

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