Results 1 to 6 of 6

Thread: Sencha Architect & ExtJS 6 TreePanel : Alignement problem

  1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    21

    Default Answered: Sencha Architect & ExtJS 6 TreePanel : Alignement problem

    HI,

    I'm using a TreePanel with a tree store. It's working expecting the text alignment of each node:

    <div unselectable="on" class="x-grid-cell-inner x-grid-cell-inner-treecolumn" style="text-align:right;">

    How is that possible ?

    mainview:
    Code:
    Ext.define('WebAlwin.view.MainView', {    extend: 'Ext.container.Viewport',
        alias: 'widget.mainview',
    
    
        requires: [
            'WebTest.view.MainViewViewModel',
            'WebTest.view.MainViewViewController',
            'Ext.tree.Panel',
            'Ext.tree.View',
            'Ext.tab.Panel',
            'Ext.tab.Tab'
        ],
    
    
        controller: 'mainview',
        viewModel: {
            type: 'mainview'
        },
        itemId: 'mainView',
        layout: 'border',
    
    
        items: [
            {
                xtype: 'treepanel',
                region: 'west',
                width: 250,
                store: 'MenuStore',
                displayField: 'name',
                viewConfig: {
                    getRowClass: function(record, rowIndex, rowParams, store) {
    
    
                    },
                    border: 1,
                    animate: true,
                    rootVisible: false,
                    listeners: {
                        itemclick: 'onMenuItemClick'
                    }
                }
            },
            {
                xtype: 'tabpanel',
                region: 'center',
                activeTab: 0,
                items: [
                    {
                        xtype: 'panel',
                        border: false,
                        title: 'Tab 1'
                    }
                ]
            }
        ]
    
    
    });
    store:
    Code:
    Ext.define('WebTest.store.MenuStore', {    extend: 'Ext.data.TreeStore',
    
    
        requires: [
            'Ext.data.proxy.Ajax',
            'Ext.data.reader.Json',
            'Ext.data.field.String',
            'Ext.data.field.Boolean'
        ],
    
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                storeId: 'MenuStore',
                autoLoad: true,
                proxy: {
                    type: 'ajax',
                    url: 'resources/data/menu.json',
                    reader: {
                        type: 'json'
                    }
                },
                fields: [
                    {
                        type: 'string',
                        name: 'name'
                    },
                    {
                        type: 'string',
                        name: 'id'
                    },
                    {
                        type: 'boolean',
                        name: 'leaf'
                    },
                    {
                        type: 'string',
                        name: 'cls'
                    }
                ]
            }, cfg)]);
        }
    });
    Last edited by mickarea; 24 Oct 2016 at 8:38 AM. Reason: missing informations

  2. There is a bug in 6.2.0 which made all grid (and tree) panels right aligned. If you don't need RTL language support, you could try to edit your app.json and replace
    Code:
    "path": "${framework.dir}/build/ext-all-rtl-debug.js"
    with
    Code:
    "path": "${framework.dir}/build/ext-all-debug.js"

  3. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    914
    Answers
    105

    Default

    There is a bug in 6.2.0 which made all grid (and tree) panels right aligned. If you don't need RTL language support, you could try to edit your app.json and replace
    Code:
    "path": "${framework.dir}/build/ext-all-rtl-debug.js"
    with
    Code:
    "path": "${framework.dir}/build/ext-all-debug.js"

  4. #3
    Sencha User
    Join Date
    May 2010
    Posts
    21

    Default

    it fix the bug, thx you very much !

  5. #4
    Sencha User
    Join Date
    Nov 2010
    Location
    Villaflores,Chiapas,Mexico
    Posts
    97
    Answers
    9

    Default

    Hi to all i'm in the same trouble, but i use the fix from hakimio
    but anything happens. I'm Using Extjs 6.2.0 Gpl
    Some ideas? Thank you.

  6. #5

    Default

    Quote Originally Posted by icebergdelphi View Post
    Hi to all i'm in the same trouble, but i use the fix from hakimio
    but anything happens. I'm Using Extjs 6.2.0 Gpl
    Some ideas? Thank you.
    Hey Hakimio,

    This is probably a little late, but maybe my fix will help others. What I did was created my store and then in columns added items and inside the items have align left.

    CREATING STORE IN THE VIEW:

    store: Ext.create('ExampleApp.store.MyTreeStore'),
    columns: {
    items:
    [ {
    text: '<b>Sort</b>',
    xtype: 'treecolumn',
    dataIndex: 'text',
    align: 'left'
    }]

    STORE:
    Ext.define('ExampleApp.store.MyTreeStore'', {
    extend: 'Ext.data.TreeStore',


    rootData: {
    text: 'First Component',
    expanded: true,
    children: [{ text: 'Child'}]
    }
    });

    Hope this helps.

  7. #6

    Default

    Quote Originally Posted by hakimio View Post
    There is a bug in 6.2.0 which made all grid (and tree) panels right aligned. If you don't need RTL language support, you could try to edit your app.json and replace
    Code:
    "path": "${framework.dir}/build/ext-all-rtl-debug.js"
    with
    Code:
    "path": "${framework.dir}/build/ext-all-debug.js"

    It fixes my bug, thank's.

Similar Threads

  1. FieldSet items alignement
    By zedascouves in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 3 Mar 2011, 3:25 AM
  2. fields alignement issue
    By xavxav in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 18 Jan 2011, 9:10 AM
  3. combo e textinput alignement
    By giordoya in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 26 May 2010, 5:02 AM
  4. make an alignement in a formPanel
    By Space23 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 28 Sep 2008, 9:03 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
  •