ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Spanning Column Headers

Open megbers opened this issue 13 years ago • 121 comments

Was wondering if there was a simple way to get multiple-column spanning for headers? It would be ideal if there was a way to group columns under a spanning header. If not, is this a feature that you could see implementing?

megbers avatar Aug 20 '13 19:08 megbers

This is definitely on my list. The folks here would love to do something like this

                                      Americas                                                                
-------------------------------------------------------------------------------------------
                    North America         |                 South America                       
-------------------------------------------------------------------------------------------                
United States | Canada | Mexico   |   Brazil | Argentina | Colombia | Venezuela | Peru|
------------------------------------------------------------------------------------------

roblarsen avatar Aug 23 '13 16:08 roblarsen

Yep, that is exactly what we are looking for, too. Please let me know if you do implement this and if we implement it (possibly as a plugin) we will let you know.

Thanks

megbers avatar Aug 23 '13 17:08 megbers

We need this feature as well, hoping this gets implemented soon. Thanks.

akommareddi avatar Sep 19 '13 15:09 akommareddi

Hello - just checking in to see if there is a plan to include this feature anytime soon. Thanks.

akommareddi avatar Nov 11 '13 16:11 akommareddi

I too really need this feature. It could be possible if I create whole new headerRowTemplate. But, it's not really a neat way.

Parrrk avatar Dec 03 '13 06:12 Parrrk

+1. I too need this feature.

sagarbehere avatar Dec 31 '13 00:12 sagarbehere

:+1:

where is the maintainer?

raitucarp avatar Jan 23 '14 10:01 raitucarp

spanning column headers is a very important feature,or I will looking for some other commercial widget grid to deal with my display issue:(

wolf1860 avatar Feb 04 '14 00:02 wolf1860

+1, would be very useful.

davidagee avatar Feb 07 '14 00:02 davidagee

Maybe this feature is not difficault as imagine...ng-Grid is good enough in fact,thanks for ur great work again!

------------------ 原始邮件 ------------------ 发件人: "David Gee"; 发送时间: 2014年2月7日(星期五) 上午8:55 收件人: "angular-ui/ng-grid"; 抄送: "1860"[email protected]; 主题: Re: [ng-grid] Spanning Column Headers (#644)

+1, would be very useful.

— Reply to this email directly or view it on GitHub.

wolf1860 avatar Feb 07 '14 00:02 wolf1860

+1, waiting for this too! And thanks for the great work!

pyrobel72 avatar Feb 08 '14 09:02 pyrobel72

This is hacky and basic but it might be a helpful starting point: http://plnkr.co/edit/Gw7KyA?p=preview

c0bra avatar Feb 18 '14 14:02 c0bra

thank u! It's a way that need make css and html tag,Every column must define the width property...it's too complexited and the UI has a little flaw. My idea is customize headerRowTemplate , define the header and column relationship by nested JSON string,other rules change nothing... But everything need the author pay a lot of hard work. thanks a lot again! thank the ng-grid team!

------------------ 原始邮件 ------------------ 发件人: "Brian Hann"; 发送时间: 2014年2月18日(星期二) 晚上10:57 收件人: "angular-ui/ng-grid"; 抄送: "1860"[email protected]; 主题: Re: [ng-grid] Spanning Column Headers (#644)

This is hacky and basic but it might be a helpful starting point: http://plnkr.co/edit/Gw7KyA?p=preview

— Reply to this email directly or view it on GitHub.

wolf1860 avatar Feb 18 '14 15:02 wolf1860

+1 waiting for this feature.

ghost avatar Mar 13 '14 20:03 ghost

Hoping for this feature as well!

michaelryancaputo avatar Mar 14 '14 16:03 michaelryancaputo

After some fiddling around, I finally managed to get a reasonable workaround.

Technically I draw a second header bar on top of the table, but use all the ngGrid classes, so it should look native and users don't see the fake.

To setup up the col spans, simply add the attribute categoryDisplayName to the columns in your columnDefs. If columns don't belong to a category, just leave it away or empty.

If two or more columns are shown next to each other, the category spans across all columns sharing the same categoryDisplayName . Resizing and regrouping columns work too.

Check out the plunker: http://plnkr.co/edit/hRYMM03y0cOMFxcgG6dR

The code is not well tested, just got it working. Any polish welcome! I hope this helps, until ngGrid v3 will make us all happy :)

firebean3 avatar May 27 '14 17:05 firebean3

Thank u! thank u very much!

------------------ 原始邮件 ------------------ 发件人: "firebean3";[email protected]; 发送时间: 2014年5月28日(星期三) 凌晨1:16 收件人: "angular-ui/ng-grid"[email protected]; 抄送: "1860"[email protected]; 主题: Re: [ng-grid] Spanning Column Headers (#644)

After some fiddling around, I finally managed to get reasonable workaround.

Technically I draw a second header bar on top of the table, but use all the ngGrid classes, so it should look native and users don't see the fake.

To setup up the col spans, simply add the attribute categoryDisplayName to the columns in your columnDefs. If columns don't belong to a category, just leave it away or empty.

If two or more columns are shown next to each other, the category spans across all columns sharing the same categoryDisplayName . Resizing and regrouping columns work too.

Check out the plunker: http://plnkr.co/edit/bluec229DT2iFJPDNrRg

The code is not well tested, just got it working. Any polish welcome! I hope this helps, until ngGrid v3 will make us all happy :)

— Reply to this email directly or view it on GitHub.

wolf1860 avatar May 28 '14 01:05 wolf1860

@firebean3, thank you for the effort. This seems to work fine when the entire table fits within the browser. If however the table needs to scroll, the top header doesn't scroll. To see the issue, resize the name field in your plunker to make it wider so that the table scrolls.

akommareddi avatar May 28 '14 03:05 akommareddi

@akommareddi, you're right. I spend some more time on it, it should work now!

firebean3 avatar May 28 '14 13:05 firebean3

@firebean3 works great !! thanks, you made a lot of people here very happy !!

akommareddi avatar May 28 '14 14:05 akommareddi