1
votes

How can i flex the width of columns in a extjs locking grid ?

If the set the flex config on columns, extjs throws an error saying locking grid columns can not specify flex values. The grid panel has layout:'fit' config set.

1
Is this a trick question?Evan Trimboli
No, Evan. why would you think so ? The grid's width varies depending upon its parent container;'s width. So if i set the column's width using px(for example say width: 100px), then columns wont flex and blank space can be seen after the last column.optimusPrime
The framework is explicitly telling you it's not supported, so the answer is "you can't".Evan Trimboli
i do realize i can not set flex config for columns. But what other way can i make the columns stretch edge to edge of grid ? Say for example, after render of table view, can i get the width and of container and then set width of each column ? I'm looking for any cleaner approach for this. ThanksoptimusPrime
What is the reason the locking grid columns cannot be flexed ? I know ext internally creates two tables one for locked and other for unlocked. But i dont get why there isn't a way to flex them.optimusPrime

1 Answers

2
votes

Looks like atleast in ExtJs 5.1.1 you just need to specify the lockedGrid's own flex:

xtype: 'gridpanel',
enableLocking: true,
layout: 'border',
split: true,
lockedGridConfig: {
    emptyText: '',
    collapsible: false,
    //forceFit: true,//<-this doesn't work
    flex: 1/4
},