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

ng-grid rowspan

Open liumin201802 opened this issue 12 years ago • 22 comments

ng-grid how to merge rows?

liumin201802 avatar Aug 26 '14 07:08 liumin201802

Can you be more specific on what you're trying to accomplish?

c0bra avatar Aug 27 '14 15:08 c0bra

Information request provided, and no further comments for at least 2 weeks. Closing on assumption that the raiser has resolved the issue.

PaulL1 avatar Sep 18 '14 22:09 PaulL1

@PaulL1 @c0bra I believe the OP was literally asking for the html table "rowspan" behavior, where a cell can span two rows (similar to colspan). Here's an example if you're not familar:

image

Anyway - was about to log this same issue, can this be re-opened now that you have explicit details?

juniorplenty avatar Jan 02 '15 22:01 juniorplenty

same example, annotated:

image

juniorplenty avatar Jan 02 '15 23:01 juniorplenty

Variations of this have been requested a couple other times:

  • https://github.com/angular-ui/ng-grid/issues/845
  • https://github.com/angular-ui/ng-grid/issues/259

juniorplenty avatar Jan 02 '15 23:01 juniorplenty

OK, understand. I'm not sure this is coming any time soon though unless someone submits a pull request including it.

PaulL1 avatar Jan 03 '15 01:01 PaulL1

This is now included in the templates tutorial: http://ui-grid.info/docs/#/tutorial/317_custom_templates.

Merging all cells in a row is reasonably straightforward, merging just some cells would be somewhat more complex, but still possible through that same mechanism.

PaulL1 avatar May 27 '15 06:05 PaulL1

Thanks @PaulL1! This is helpful, but I think this is applicable to the use case of colspan instead of rowspan. Any ideas on a way to achieve the same merging effect vertically?

spencerhandley avatar Jul 07 '15 13:07 spencerhandley

If you are looking to do this you could probably do it visually using a custom cell template. I know that it's less than ideal but it will fix your problem.

JLLeitschuh avatar Jul 07 '15 16:07 JLLeitschuh

Awesome, it seems to be working thanks!

spencerhandley avatar Jul 09 '15 15:07 spencerhandley

Hi, I am also stuck up with the same rowspan issue and not able to find any sample example for it. Going through the discussion chain found that it can be done, can anyone share the sample example

infyravi avatar Nov 05 '15 13:11 infyravi

Hi, Has the ROWSPAN feature added to ui-grid or not? I am not able to find any inforamtion about it.

trupti18 avatar Dec 21 '15 14:12 trupti18

found a workaround for doing it

On Mon, Dec 21, 2015 at 7:39 PM, Trupti Ranjan Swain < [email protected]> wrote:

Hi, Has the ROWSPAN feature added to ui-grid or not? I am not able to find any inforamtion about it.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-grid/issues/1464#issuecomment-166312787 .

infyravi avatar Dec 21 '15 15:12 infyravi

Can you share the workaround.

trupti18 avatar Dec 21 '15 15:12 trupti18

@trupti18 do you have a workaround for the ROWSPAN feature?

ghost avatar Feb 02 '16 13:02 ghost

Do you have any informations about ROWSPAN, anyone know an example of ROWSPAN ???

damianbazarko avatar May 25 '16 08:05 damianbazarko

hello @infyravi, could you please share your solution? thanks

danilofaria avatar Jul 18 '16 15:07 danilofaria

I arranged a RowSpan hack, suitable for my need, not necessarily for everyone: I use position:absolute on the top row's cell and display:none on the spanned rows' cells. See http://plnkr.co/edit/TiQFJnyOvVECOH2RL4ha?p=preview

Everything is in the ng-style in the cell template, which uses a 'spanCompany' attribute to know the number of rows to override. We have to calculate the height and width since we are position:absolute. This also means the width has to be expressed in pixels, not %.

ng-style="{ height:21*row.entity.spanCompany + \'px\', width:col.width+\'px\', position:\'absolute\', display:row.entity.spanCompany==0?\'none\':\'block\', borderStyle:\'dotted\', borderWidth:\'1px\'}"

bvoisin avatar Nov 23 '16 15:11 bvoisin

@bvoisin thanks for your solution; but the div.ui-grid-row has a dynamic style, "transform: translateY(); ", which is a big problem when scrolling So, do you have any idea to solve transform effecting?

qmy777 avatar Jan 22 '17 09:01 qmy777

Arg... indeed, here is a modified plunker that shows the scrolling problem @qmy777 just pointed out: http://plnkr.co/edit/T4xUE60QvH8gxuJE31o4?p=preview

just scroll down.

I will look into it in the coming days.

bvoisin avatar Jan 22 '17 21:01 bvoisin