0

I have a MultiGrid component with a single fixed row. I would like to print the result, but since multiple columns overflow on the x-axis, the print output gets truncated.

Is it possible to wrap each row in another element and then use display table-cell/table-row to get the desired, table-like behavior? The added benefit is that a table can easily stretch the entire page, even if the number of columns is low.

mateusz
  • 1,127
  • 1
  • 8
  • 10

1 Answers1

0

Is it possible to wrap each row in another element

Yes. It would be possible to wrap rows by injecting your own cellRangeRenderer property. That being said, I don't really recommend it. RV doesn't really have "rows" or "columns"- just positioned cells. Wrapping would add extra elements which could slow down scroll performance. (Probably not much, but every little bit counts for scrolling.)

and then use display table-cell/table-row to get the desired, table-like behavior?

If you're using MultiGrid I assume you have enough columns to warrant windowing horizontal data as well as vertical? In which case, I don't think display:table would really work for you. I'm not sure what it would buy you.

Have you considered just rendering a non-RV layout specifically printing? I Haven't done this myself but maybe you could tap into beforeprint/afterprint and setState to render a different result? Alternately you could try setting overflowColumnCount really high when print mode is enabled to just render the entire horizontal axis.

I don't really have much experience with this unfortunately. It might require a little of experimentation on your part for the best performing solution. :)

bvaughn
  • 13,300
  • 45
  • 46
  • Thanks. I ended up having two components - one table and one grid. Table being shown with a print media query, grid otherwise. I have some functionality that hides user-specified columns, so it works out. – mateusz Jul 11 '17 at 23:11