-
21 Apr 2011 4:50 AM #1
Ext.ux.grid.VarHeaders - short/normal/long column headers
Ext.ux.grid.VarHeaders - short/normal/long column headers
So finally I got around to port one of our smallest plugins to ExtJS 4.
The first version was created last year on request by a client, who wanted different text on a column header if the column is smaller or wider:
varheaders.png
Here is the demo and download page
Comments are welcome.
Some related ramblings on our new team blog: fit4devExtJS 4 plugins:
varheaders - short/normal/long column header
clearbutton - mouseover clear button in text field
Blog: fit4dev
ExtJS User Group Hamburg
-
21 Apr 2011 5:11 AM #2
-
21 Apr 2011 9:29 AM #3
-
6 May 2011 2:02 AM #4
Not working with 4.0.0 ?
Not working with 4.0.0 ?
Hi Stephen,
I've tried using ext-4.0.0 and it does nothing (no errors in firebug also). Tried with ext-4.0-beta3 and it works as shown in the demo.
When comparing Container.js files located in src/grid/header/, it seems several events have been renamed from 'header...' to 'column...', e.g. 'headerresize' changed to 'columnresize' (among a dozen other changes) from beta 3 to release.
Far from being an expert in Ext, I suggest to change line
(in VarHeader.js fn addListeners) toCode:headerCt.on('headerresize', this.handleColumnHeaderResize, this);
to make this work in 4.0.0 again.Code:headerCt.on('columnresize', this.handleColumnHeaderResize, this);
Thx
ClausT
(having a hard time understanding Ext4)
-
6 May 2011 4:00 AM #5
Thanks a lot!
I was a little slow to check this with Ext 4 final.
I have updated the plugin page.ExtJS 4 plugins:
varheaders - short/normal/long column header
clearbutton - mouseover clear button in text field
Blog: fit4dev
ExtJS User Group Hamburg
-
6 May 2011 5:29 AM #6
I've tried to use the plugin on a grid with locked columns. This throws an error grid.headerCt is undefined in the init function. A grid with locked columns does not have a headerCt. Instead, it has two items that are gridpanels.
My workaround is to change the init routine:
While this is working for me, I am not sure if this is the best way to do it.Code:init: function(grid) { if(grid.headerCt){ grid.headerCt.cascade(this.addListeners, this); } else { grid.items.items[0].headerCt.cascade(this.addListeners, this); grid.items.items[1].headerCt.cascade(this.addListeners, this); } },
Thx
ClausT
-
7 May 2011 11:38 AM #7
Good catch.
I updated the plugin and also added a small locked grid example to the demo page to verify.
Additionally I noticed that the calculation was a few pixels off in 4.0.0 final. I fixed that, too.
Thanks for the feedback!ExtJS 4 plugins:
varheaders - short/normal/long column header
clearbutton - mouseover clear button in text field
Blog: fit4dev
ExtJS User Group Hamburg
-
5 Jul 2012 5:38 AM #8
I adjusted the handleColumnSortChange function a little bit, so it also updates the text of the last column you sorted by.
Also it would be nice if the text in the header menu would always be the longest version available. Currently it uses whatever text is present in the column headers at the time the menu is created.Code:handleColumnSortChange: function(headerContainer, column, direction) { this.updateColumnTextIfNeeded(column); if (this.lastSortColumn) { this.updateColumnTextIfNeeded(this.lastSortColumn); } this.lastSortColumn = column; }
-
5 Jul 2012 5:57 AM #9
Ignore the menu thing, didn't know about menuText and used this in combination with an override.
Code:Ext.define("Ext.override.grid.column.Column", { override: "Ext.grid.column.Column", initComponent: function() { this.menuText = this.menuText || this.text; this.callParent(); } });
-
10 Oct 2012 9:02 AM #10
+1
really good, easy plugin. Add a very cool "wow" factor to my grids.
Thank you
Similar Threads
-
How to show the tooltip of button with a long width but a short text?
By zch_heero in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 24 May 2010, 10:52 PM -
grid column wrap normal but edit weird
By huhulucy90 in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 1 Oct 2009, 11:11 PM -
Why have two versions (short hand and long form) of so many methods and properties?
By Arthur.Blake in forum Community DiscussionReplies: 6Last Post: 22 Apr 2008, 11:11 PM


Reply With Quote