PDA

View Full Version : What happened to Ext.grid.Grid.autoSizeColumns?



alex.tomes
11 Dec 2007, 5:47 AM
Hey guys, I've been looking in the docs for the ColumnModel looking for somewhay to autoSize the header of a grid and I found :


width : Number
(optional) The initial width in pixels of the column. Using this instead of Ext.grid.Grid.autoSizeColumns is more efficient.

I understand that Ext.grid.Grid.autoSizeColumns is deprecated (you should update the docs because it's linking to nothing in that page) but is there a way to take advantage of this kind of functionality using ext2.0?

Thank you in advance!

phillroberts
11 Dec 2007, 7:10 AM
The GridView has a forceFit property that will fit the grid to the size of your container. In the grid config, you can specify a viewConfig property that takes the config options of the GridView, so everything can be specified in your grid's config.

e.g. here's an example


var grid = new Ext.grid.GridPanel({
store: somestore,
columns: somecolumnmodel,
viewConfig: {
forceFit: true
},
width:600,
height:300,
frame:true,
title:'Example Grid using viewConfig'
});

alex.tomes
11 Dec 2007, 7:27 AM
Thank you Phill, I am aware of that config option but I don't want my grid to fit to a container, I dynamically generate the columnModel (I am using the Autogrid presented here on the forum) and columns may be more than to fit comfortably on the screen (a horizontal scroll bar may appear ). So you see, if I have 20 headers and my container is 800px I am not looking to stretch them all in, I am looking for something to behave sort of like a html table (a kind of autosize)

Maybe it would be better to generate widths also from serverside (at least to have the width of the header's name).

Animal
11 Dec 2007, 7:30 AM
try adding this to your overrides:



Ext.override(Ext.CompositeElement, {
getTextWidth: function() {
var i, e, els = this.elements, result = 0;
for(i = 0; e = Ext.get(els[i]); i++) {
result = Math.max(result, e.getTextWidth.apply(e, arguments));
}
return result;
}
});

Ext.override(Ext.grid.GridPanel, {
autoSizeColumns: function() {
this.colModel.suspendEvents();
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
this.colModel.resumeEvents();
this.view.refresh(true);
},

autoSizeColumn: function(c) {
var col = this.view.el.select("td.x-grid3-td-" + this.colModel.getColumnId(c) + " div:first-child");
if (col) {
var w = col.getTextWidth() + Ext.get(col.elements[0]).getFrameWidth('lr') + 2;
this.colModel.setColumnWidth(c, w);
return w;
}
}
});

sayanb
11 Dec 2007, 7:40 AM
Hi All,

I am a complete newbie to web technologies and chose ExtJS to minimise the learning curve and deliver a good looking product.

I have hit a recent snag while trying out a grid example. My issue is two folds:

1. As mentioned in the title, I can not get the grid to autofit in a container no matter what I did. See below for HTML and JS snippets.

2. I believe I might have a rather unstable version of ExtJs 2.0. (Many examples just start working when I switch from 2.0 to 1.x libraries). Could you tell me if there is a stable version, and where to get it from ?

Code Snippets ##############################
HTML:
<div id="grid-example" style="overflow: hidden; width: 500px; height: 125px;border:2px solid #999;margin:20px 50px;visibility:hidden;"></div>

JS:

var colModel = new Ext.grid.ColumnModel([
{header: "Company", width: 120, sortable: true, dataIndex: 'company'},
{header: "Price", width: 90, sortable: true, dataIndex: 'price'},
{header: "Change", width: 90, sortable: true, dataIndex: 'change'},
{header: "% Change", width: 90, sortable: true, dataIndex: 'pctChange'},
{id:'Last Updated',header: "Last Updated", width: 120, sortable: true,
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'}
]);

var grid = new Ext.grid.Grid('grid-example',
{
ds: ds,
cm: colModel,
viewConfig:{forceFit: true},
title: 'My First Grid',
width: 500,
autoExpandColumn: 'Last Updated',
frame: true
});

tryanDLS
11 Dec 2007, 9:28 AM
@sayanb
1) Please don't hijack threads to ask a new question - start a new thread.
2) Post your code in CODE tags.
3) The 2.0 Final release is available from the download page.
4) You cannot blindly expect 1.x code to work with 2.0 - if this is what you're trying to do, you need to read the migration guide, which is available here http://extjs.com/learn/

tratsch
12 Dec 2007, 7:53 AM
I'm new to ExtJs and downloaded the new version.

The first I tried was the GridPanel.

The first what surprised me was that the columns are not sized automatically according to the widest entry.

So I searched the examples, API and forums but didn't get an answer. Now I learned that this feature existed in Version 1.1.1. So why did you remove it? Why copy complicated Methods instead? A simple HTML-Table handels this better. It should not only be possible but default-behaviour of GridPanels!

tryanDLS
12 Dec 2007, 9:46 AM
I'm new to ExtJs and downloaded the new version.

The first I tried was the GridPanel.

The first what surprised me was that the columns are not sized automatically according to the widest entry.

So I searched the examples, API and forums but didn't get an answer. Now I learned that this feature existed in Version 1.1.1. So why did you remove it? Why copy complicated Methods instead? A simple HTML-Table handels this better. It should not only be possible but default-behaviour of GridPanels!
The reasons for removing this functionality have been discussed on a number of threads - try searching. As a new user, I would think you would spend a little time understanding what is going on, before trying to dictate what should be default behavior for the framework.

tratsch
14 Dec 2007, 2:04 AM
Why are you assuming that I didn't try "to find out what's going on" first? Be asured that I searched a lot, before I made my post. All I could find were hints for "autoExpandColumn" or "forceFit" from helpful people which didn't get the point of the problem.

I don't want to dictate anything. All I can say is that a lot of new users will be surprised by this behaviour of the GridPanel. If there are good reasons to remove this functionality you probably should mention them in the API...and a hint about how to solve the problem too.

jfkelley
17 Dec 2007, 7:40 AM
I'm a confessed newbie, but I, too, have spent hours looking through the forums and am stumped on what I think is the key issue in this thread:

If I build a basic html table and let it be, width-wise (i.e., no width attributes anywhere in the td, table, or the containing div), the browser finds a natural width for each column. The table is only as wide as it has to be to accommodate all the text. This is nice and compact and easy to scan visually when all the data elements for a column are of similar sizes.

In my newbie experiments with ext.js grids, the tables seem to either want me to hand-code widths ahead of time (which confounds data with presentation in unacceptable ways), or else they grow to the full width of the available space (which introduces a lot of horizontal space and interferes with visual scanning).

I'm guessing there's an option (that I haven't been able to find yet in the API Docs or the forums) that I would apply to the "grid = new Ext.grid.GridPanel" section that would enable this sort of basic natural-width behavior? I.e. use as much width as you need for each column, but no more.

I tried various things I inferred from the forums (like autoSizeColumns: true, autoWidth: true), but none of them seemed to work. (I just re-downloaded the latest ext.js 2.0).

Can someone tell me how to make this work (or point me to an example that works)?

I am guessing from my searching that there are several threads that touch, at least obliquely, on my question, but I haven't found the definitive statement of the question and the definitive answer yet. So, apologies for any redundancy. I sure don't want to "hijack" anything (now that I've discovered that such a thing exists and is not preferred behavior! (:|

I'm using examples/grid/array-grid.html as my base of experimentation, if that matters.

Chemist
22 Apr 2008, 3:40 AM
try adding this to your GridPanel prototype:



autoSizeColumns: function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
},

autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w);
return w;
}


I've added this to my prototype. And what should I do then? When I have to call this functions? I'm extending Ext.grid.GridPanel

pokerking400
30 Apr 2008, 7:46 PM
i am also have same problem...i was trying to fit the grid to the tab panel in the middle. it firts horizontally but vertically it takes actual height that is specified. This is first impression..

i still have to dig more...if some one know this , let me know.

it is same file in the examples grid directory called paging.

var grid = new Ext.grid.GridPanel({
el:'topic-grid',
frame:true,
height:1000,
title:'ExtJS.com - Browse Forums',
store: store,
cm: cm,
trackMouseOver:false,
sm: new Ext.grid.RowSelectionModel({selectRow:Ext.emptyFn}),
loadMask: true,
viewConfig: {
forceFit:true,
fitcontainer:true,
enableRowBody:true,
showPreview:true,
getRowClass : function(record, rowIndex, p, store){
if(this.showPreview){
p.body = '<p>'+record.data.excerpt+'</p>';
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
},

thanks.

Animal
30 Apr 2008, 11:24 PM
height:1000 ???

piskui07
29 May 2008, 5:00 AM
Does anyone find a solution to this problem?

Maybe... we can use TextMetrics uitlity class to compute the dimensions of each cell value?

But how?

Animal
29 May 2008, 5:05 AM
Ummmm, I just posted a solution?

Ellevo
29 May 2008, 11:27 AM
It work's pretty fine Animal ;)

What I did :

this.store.on('load',this.autoSizeColumns,this);

...

autoSizeColumns: function() {

for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.doAutoSizeColumn(i);
}
}
,autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w + 5);
return w;
}

Howdy
4 Jun 2008, 1:18 PM
this.store.on('load',this.autoSizeColumns,this);
Where in the code does this line go? :-/

bt_bruno
7 Jun 2008, 10:58 AM
Where in the code does this line go? :-/

When you have a grid, you have to define a store for it. Soo, aftr the grid creation, you can put this line. Or if you are extending the GridPanel component, on the initComponent method you can put this line.

--maty
18 Jun 2008, 7:24 AM
Ummmm, I just posted a solution?Sounds strange. I'm not gonna to offense you but i can't find such property in API documentation and your code doesn't work with my table which is based on ExtJS 2.1... Moreover, when i tried to debug it, i saw that FB just ignore the autoSizeColumns property. So, could you pls point me to the exact property in API browser?
----
Forget it, i was wrong :)
Cheers, and thx for the useful tip.

harperml
8 Jul 2008, 12:23 PM
Hi,

I would appreciate some information on how you actually got the code right. I am attaching my use of it but the handler is not activated for some reason. I suspect there is something amiss with my 'on' call but do not understand what.

thanks



function buildValueTable(tableData) {

var records = [ {name: 'id'}, {name: 'label'} ];
var columnTags = tableData.columnTags;
for (var i = 0; i < columnTags.length; i++) {
records.push( {name: columnTags[i]} );
}

var record = Ext.data.Record.create( records );

var reader = new Ext.data.JsonReader({
root: "rows",
id: "id"
}, record);

var store = new Ext.data.Store({
reader: reader,
data: tableData
});

var headers = tableData.headers;
var columns = [{id: 'label', header: verticalText(headers[0]), width: 100, dataIndex: 'label'}];
for (var i = 1; i < headers.length; i++) {
var dataIndex = columnTags[i - 1];
columns.push({id: dataIndex, header: verticalText(headers[i]), width: 100, dataIndex: dataIndex});
}

var colModel = new Ext.grid.ColumnModel( columns );

var grid = new Ext.grid.GridPanel({
title: tableData.name,
store: store,
cm: colModel,
//minColumnWidth: 50,
autoSizeColumns: function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
},
autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w);
return w;
},
//autoExpandColumn: 'descr',
// Do this since vertical text for IE screws up this menu
// Looks as though the vertical text for headers in IE is confusing the
// column width calculation; it can become too small
enableHdMenu: false,
frame: true,
stripeRows: true,
region: 'center',
margins:'3 3 3 0',
viewConfig: { autoFill: true },
//width: 700,
height: 200
});

grid.store.on('load',this.autoSizeColumns,this);

return grid;
}

mjlecomte
8 Jul 2008, 12:41 PM
what is this? I suspect it's the browser window or something.

For example what do you see in firebug with this code:


...
console.dir(this);
grid.store.on('load',this.autoSizeColumns,this);
return grid;


What if you do this:

grid.store.on('load',grid.autoSizeColumns,grid);

harperml
8 Jul 2008, 12:49 PM
For the firstI get the window object. I had tried the second suggestion also and got the same behavior.


what is this? I suspect it's the browser window or something.

For example what do you see in firebug with this code:


...
console.dir(this);
grid.store.on('load',this.autoSizeColumns,this);
return grid;


What if you do this:

grid.store.on('load',grid.autoSizeColumns,grid);

mysticav
12 Jul 2008, 6:40 PM
This worked for me:

grid.store.on('load',grid.autoSizeColumns,grid);

instead of :

grid.store.on('load',this.autoSizeColumns,this);

bt_bruno
24 Jul 2008, 3:48 AM
there's a bug in this "autoSizeColumns" code.

The columns are autoSized pretty fine, but when you click on "reload" button (PagingToolbar), the columns become smaller...A difference of 2,3px...

TomToms
28 Jul 2008, 5:46 AM
there's a bug in this "autoSizeColumns" code.

The columns are autoSized pretty fine, but when you click on "reload" button (PagingToolbar), the columns become smaller...A difference of 2,3px...

I tried it after dropping a node on the grid, with the same result:
The columns became smaller.

I fixed this problem by adding +2.3 to the width:


,autoSizeColumns: function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
}
,autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w+2.3);
return w;
}
Now, everything works perceft ;)

Thanks Animal for this great code snippet.

Edit:
There's another problem: If you're deleting the column with the maximum width, the grid does not resize to the column with the next maximum width...

bt_bruno
28 Jul 2008, 10:00 AM
hahaha...What a workaround! I did this too. But 2.3 the columns were growing pixel by pixel every time I refreshed the grid. I put 2.0 and it's ok ;]

TomToms
28 Jul 2008, 11:36 PM
There's another problem: If you're deleting the column with the maximum width, the grid does not resize to the column with the next maximum width...
This problem is fixed, if you're adding this.colModel.setColumnWidth(c, 1); at the beginning of the autoSizeColumn-function.
If you are using it, the setColumnWidth at the end have to be a minimum width of w+2 to show the grid correct. The higher the number, the columns widen. A width of w+5 to w+10 seems to be the best choice.



,autoSizeColumn: function(c) {
this.colModel.setColumnWidth(c, 1);
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w+5); // +5 to +10
return w;
}

bluestar84
19 Aug 2008, 6:46 AM
Hi guys,

i have the same problem as some other users in here. I don't get how to implement the code pieces into the 'main' sourcecode. This is my first try using Ext JS so please be lenient with me ;-)

this is my quellcode:


listColumnModel.defaultSortable= true;

var listDataStore = new Ext.data.JsonStore({
id: 'listDataStore',
data: listData,
reader: new Ext.data.JsonReader()
}); // listDataStore

var listGrid = new Ext.grid.GridPanel({
store: listDataStore,
cm: listColumnModel,
viewConfig: {
forceFit: true
},
fitcontainer:true,
height:550,
width:800,
title: 'Kategorien ',
autoExpandColumn: '2'
,autoSizeColumns: function() {
for (var i = 0; i < this.listColumnModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
}
,autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.listDataStore.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.listColumnModel.setColumnWidth(c, w+2.3);
return w;
}



}); // listGrid

listGrid.listDataStore.on('load',listGrid.autoSizeColumns,this);
return listGrid;
...without the resize function everything works nearly perfect, except the dynamic resizing ;-)

Did I make any mistake in implementing the code?

Thanks in advance.

Greetings
bluestar84

jpnet
19 Aug 2008, 7:58 AM
You need to inherit or "extend" the Grid. IE:


yourGrid = Ext.extend(Ext.grid.GridPanel,
{
constructor: function( /*put your code here*/) {},
initComponent: function() {/*put your code here*/},
autoSizeColumns: function() { /* CODE THAT WAS POSTED PREVIOUSLY*/ }
}


Then you call...



var someGrid = new yourGrid(/*pass config params*/)
someGrid.autoSizeColumns();


That's how I understand it. Be sure to read Saki's tutorial on writing a big Ext application. It discusses inheritance in more detail.

-JP

mysticav
19 Aug 2008, 8:48 AM
Can somebody point me to the thread where they explain why this functionality was removed from Ext 2.0 ?

I would like to know why a very usual and common grid behavior is not included as part of the framework.

zhahua
15 Oct 2008, 6:52 AM
Curious about this too. Because I am facing the same problem :)


Can somebody point me to the thread where they explain why this functionality was removed from Ext 2.0 ?

I would like to know why a very usual and common grid behavior is not included as part of the framework.

pbuyle
26 Nov 2008, 7:20 AM
I usedf to previous solution with the following autoSizeColumn


autoSizeColumn: function(c) {
//Get the size of the header
var w = Math.max(this.view.getHeaderCell(c).scrollWidth, this.view.getHeaderCell(c).firstChild.scrollWidth);
for (var i = 0, l = this.store.getCount(); i < l; i++) {
var cEl = Ext.fly(this.view.getCell(i, c).firstChild);
//Avoid resizing checbox columns
if(!cEl.hasClass('x-grid3-col-checker')) {
w = Math.max(w, cEl.dom.scrollWidth + cEl.getBorderWidth('lr') + cEl.getPadding('lr'), cEl.dom.scrollWidth);
}
}
this.colModel.setColumnWidth(c, w);
return w;
},

tomlobato
22 Dec 2008, 2:22 PM
I used the code from this thread (animal, TomToms and others) and added something for use the initial width of a column as its minimal width.
It is working very well for me. I hope it can be util for others...

after grid definition:

grid.store.on('load',grid.autoSizeColumns,grid);GridPanel prototype:

// autosize columns of grid
Ext.apply(Ext.grid.GridPanel.prototype, {
autoSizeColumns : function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
},
autoSizeColumn : function(c) {
initWidth = this.colModel.getColumnWidth(c) - 5

colId = this.colModel.getColumnId(c)
colObj = this.colModel.getColumnById(colId)
if (typeof colObj.initWidth == 'undefined')
colObj.initWidth = initWidth

this.colModel.setColumnWidth(c, 1);
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w,
this.view.getCell(i, c).firstChild.scrollWidth);
}
w = Math.max(w, colObj.initWidth);
this.colModel.setColumnWidth(c, w+5);
return w;
}
});

PSB
13 Feb 2009, 3:38 PM
try adding this to your GridPanel prototype:



autoSizeColumns: function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
},

autoSizeColumn: function(c) {
var w = this.view.getHeaderCell(c).firstChild.scrollWidth;
for (var i = 0, l = this.store.getCount(); i < l; i++) {
w = Math.max(w, this.view.getCell(i, c).firstChild.scrollWidth);
}
this.colModel.setColumnWidth(c, w);
return w;
}


maybe this code?


autoSizeColumns : function() {
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}

var TotalColumnWidth=this.getColumnModel().getTotalWidth(false);
var TotalGridWidth=this.getInnerWidth();

if(TotalColumnWidth>TotalGridWidth){
if(this.autoExpandColumn){
var NotExpandColumnWidth=this.autoSizeColumn(this.getColumnModel().getIndexById(this.autoExpandColumn));
var ExpandColumnWidth=this.getColumnModel().getColumnWidth(this.getColumnModel().getIndexById(this.autoExpandColumn));
var NewExpandColumnWidth=ExpandColumnWidth-TotalColumnWidth+TotalGridWidth-5;

if(NewExpandColumnWidth>100) this.getColumnModel().setColumnWidth(this.getColumnModel().getIndexById(this.autoExpandColumn),NewExpandColumnWidth);
}
}
},

jit
1 Apr 2009, 3:41 AM
Thanks animal, great solution, exactly what I was looking for!

I made a minor change to allow for a minWidth property that can be specified against a column.



Ext.override(Ext.CompositeElement, {
getTextWidth: function() {
var i, e, els = this.elements, result = 0;
for(i = 0; e = Ext.get(els[i]); i++) {
result = Math.max(result, e.getTextWidth.apply(e, arguments));
}
return result;
}
});
Ext.override(Ext.grid.GridPanel, {
autoSizeColumns: function() {
this.colModel.suspendEvents();
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
this.colModel.resumeEvents();
this.view.refresh(true);
},

autoSizeColumn: function(c) {
var col = this.view.el.select("td.x-grid3-td-" + this.colModel.getColumnId(c) + " div:first-child");
if (col) {
var w = col.getTextWidth() + Ext.get(col.elements[0]).getFrameWidth('lr') + 2;
var minWidth = this.colModel.getColumnById(this.colModel.getColumnId(c)).minWidth;
if ((minWidth) && (w < minWidth)) {
w = minWidth;
}
this.colModel.setColumnWidth(c, w);
return w;
}
}
});


Jit

BulletzBill
18 Jan 2011, 2:55 PM
Sorry to revive this old topic but I have not seen any more current topics relating to this issue. Anyway, I am attempting to use the proposed overrides in 3.3.0 and every implementation of autoSizeColumn() in this thread works ok when a grid's store is loaded for the first time, but for every load after that (refresh, page change, ect.) the width of the columns keep increasing by a small amount, maybe several pixels increase in each column. Any ideas of what may be causing this?

RenatoLombardo
19 May 2011, 11:45 AM
It's an old topic, but since it's meant to be the "official" solution for autoSize, I'm still on it.

Well, it appears, that it doesn't works on 3.3, giving the following error:

col.getTextWidth is not a function


try adding this to your overrides:



Ext.override(Ext.CompositeElement, {
getTextWidth: function() {
var i, e, els = this.elements, result = 0;
for(i = 0; e = Ext.get(els[i]); i++) {
result = Math.max(result, e.getTextWidth.apply(e, arguments));
}
return result;
}
});

Ext.override(Ext.grid.GridPanel, {
autoSizeColumns: function() {
this.colModel.suspendEvents();
for (var i = 0; i < this.colModel.getColumnCount(); i++) {
this.autoSizeColumn(i);
}
this.colModel.resumeEvents();
this.view.refresh(true);
},

autoSizeColumn: function(c) {
var col = this.view.el.select("td.x-grid3-td-" + this.colModel.getColumnId(c) + " div:first-child");
if (col) {
var w = col.getTextWidth() + Ext.get(col.elements[0]).getFrameWidth('lr') + 2;
this.colModel.setColumnWidth(c, w);
return w;
}
}
});

jmariani
21 May 2011, 10:45 AM
For 3.3, I've found that you need to override CompositeElementLite instead of CompositeElement

RenatoLombardo
23 May 2011, 8:53 AM
That works! Thank you.

sraghura201
16 Aug 2011, 11:52 AM
Continuing with treating this as the official thread:

in ext 4.0.0 override is not an available method for Ext.CompositeElementLite It is however for Ext.CompositeElement Overriding Ext.CompositeElement however still produces the col.getTextWidth() is not a function error. So in the 4.0 version, where should getTextWidth go?