PDA

View Full Version : Ext.ux.GridGroupView



JorisA
30 Jul 2007, 3:47 PM
I created a groupview for the Grid2 widget. It maybe not as fancy as jack's one, but as long as there's no Ext 2.0 this suits my needs.

config params are groups, groupBy and emptyText.
If groups is false, it will detect groups by itself.
If no records for a group are found, emptyText is shown.

It's also possible to create groups dynamically on render:

this.grid.on('render', function(grid) {
var groups = [];

// add a group for every day in current month

grid.getView().groups = groups;
}, this);

See the example + source files for more info and stuff.

http://joris.magicfly.nl/dev/extux/ux/autogrid/

galdaka
31 Jul 2007, 12:17 PM
Excellent work!!

Is the first step to categorized views. Are you plain insert a collapse / expand functionallity?

Thanks in advance,

JorisA
31 Jul 2007, 12:30 PM
There is one in Ext 2.0 already. I just need this for my Ext 1.1 project and I tought maybe I can help others with it.

IGx89
31 Jul 2007, 4:25 PM
Looks good! Just a quick bug report in IE7 (haven't tested others): no items under the second group in a grid page can be selected (and double-clicking them throws an error)

galdaka
1 Aug 2007, 4:38 AM
Are you plain insert a collapse / expand functionallity?

JorisA
1 Aug 2007, 10:45 AM
Looks good! Just a quick bug report in IE7 (haven't tested others): no items under the second group in a grid page can be selected (and double-clicking them throws an error)

I noticed :(
This is because the header rows increment the rowIndex as well. I don't really know how to fix this an easy way, so for now I made a ugly fix (demo updated).

Use this for retrieving the "real" rowIndex:

rowIndex = grid.getView().translate[rowIndex];

And as I replied before no collapse stuff.

fausastu
6 Aug 2007, 1:02 PM
Do you think to include grouping functions? (sum, avg)

Regards

JorisA
6 Aug 2007, 1:24 PM
No sorry. this was just a temporary solution I needed while waiting for the official group view in ext 2.0.

trbs
6 Aug 2007, 3:04 PM
cool stuff joris !

small bug report from my end:
i played around some with the buttons "load", "load+meta" and "load+alt meta" and then i double clicked on entries in the "Stupid Ones" group. Where is renders IBM i get BOTECH in the editor cell. same thing with Alcoa Inc it editor cell renders to MySQL Group. (and when i start editing cells. all hell breaks lose)

Seems like the editor cell selections do consider the group headers as valid rows...

Anyways, great extention, i was thing of something like this myself for a project, but decided too go with Ext2 as it's tentative timeline currently fit our project timeline.

p.s. i see this is similar to the earlier report... so maybe it's my bad, and i just should leave cell editing alone :P

vaduros
12 Aug 2007, 1:32 PM
Nice solution and something I was looking for. But there seems to be an issue in the paging toolbar of the Auto Grid. When I load meta data, it shows 'NaN' for the number of records.

galdaka
27 Aug 2007, 12:38 AM
Nice solution and something I was looking for. But there seems to be an issue in the paging toolbar of the Auto Grid. When I load meta data, it shows 'NaN' for the number of records.

same error

Erwan62
15 Jun 2009, 4:37 AM
Dead link, we can't see the source code...