user6226486
user6226486

Reputation: 13

Extjs6 treegrid column scrollable does not work

I'm using ExtJs6,but when I using the TreeGrid I want the scroll bar in the column when I expand more node on the tree ,I don't want the column width change. So the value can't display complete, I saw the docs

scrollable : Boolean / String / Object Configuration options to make this Component scrollable. Acceptable values are: true to enable auto scrolling. false (or null) to disable scrolling - this is the default. x or horizontal to enable horizontal scrolling only y or vertical to enable vertical scrolling only Also accepts a configuration object for a Ext.scroll.Scroller if if advanced configuration is needed. The getter for this config returns the Ext.scroll.Scroller instance. You can use the Scroller API to read or manipulate the scroll position:

but I write the code like this:

{
    xtype: 'treecolumn', //this is so we know which column will show the tree
    text: 'operation',
    sortable: true,
    width: 200,
    border: 5,
    scrollable: true,
    dataIndex: 'operation',
    menuDisabled: true,
    autoSizeColumn: true
}

it was not work..

Upvotes: 1

Views: 767

Answers (1)

Alexander
Alexander

Reputation: 20224

The grid column body cannot have a scrollbar. gridcolumn derives from component, but all the inherited configs and properties are configuring the column header.

The way the gridpanel is rendered underneath (the way the HTML is generated) rules out any simple and performant way of adding horizontal scrolling to a single column.

Depending on your use case, you can add your treecolumn as a locked column.

In the lockedGridConfig you can then provide a fixed width for the locked part of the grid, and scrollable:true. This is the only way I see to have that column scroll horizontally independently from the rest of the grid.

Fiddle: https://fiddle.sencha.com/#fiddle/1faf

Upvotes: 0

Related Questions