fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

DetailsList: Ability to make header fixed

Open notgiorgi opened this issue 9 years ago • 11 comments

It would be convenient to have a prop isHeaderFixed on DetailsList component.

notgiorgi avatar Feb 28 '17 13:02 notgiorgi

+1

willtrking avatar Sep 12 '17 20:09 willtrking

+2, should be able to fix the first column or two as well

russgove avatar Nov 12 '17 21:11 russgove

+1

roger-green avatar Dec 05 '17 22:12 roger-green

+1

nataaad avatar Dec 06 '17 09:12 nataaad

+1

marlonbrgomes avatar Dec 14 '17 14:12 marlonbrgomes

Related to #3378. You can make the header fixed but then the body does not render all the rows in the list when you scroll. There may be a way to do that so we have the sticky header before a fix is put in. If we can tell the underling list to render the rows correctly as it is scrolled, we would have a solution to this.

aappddeevv avatar Jan 07 '18 21:01 aappddeevv

Scrollable Pane with Detail List resolves this issue. https://developer.microsoft.com/en-us/fabric#/components/scrollablepane. Closing Issue.

oengusmacinog-zz avatar Jan 31 '18 19:01 oengusmacinog-zz

This works in Detailslist now? I'm confused.

betrue-final-final avatar Jan 31 '18 20:01 betrue-final-final

Check out the example link that is listed in the comment. Essentially you wrap the header (using the header renderer) in a Sticky and wrap everything in a ScrollablePane. So composed together it becomes a solution.

aappddeevv avatar Feb 12 '18 18:02 aappddeevv

I've taken the example code and inserted into a simple create-react-app app. However, I just can't get the sticky's to stick inside the scroll area (they stick to the top of the page instead). This certainly looks like a CSS issue, but I am stumped. If anyone has any ideas, this would be really appreciated! I've uploaded a simple test project here :

https://[email protected]/rockgobyx/fabric-react-test.git

(I can fudge it using some absolute position values, but I would like to find a better solution)

stickyish

roger-green avatar Mar 21 '18 09:03 roger-green

Here is how I have implemented stick headers in detail list.

<ScrollablePane>
    <DetailsList
            items={items}
            compact={false}
            columns={columns}
            selectionMode={SelectionMode.single}
            layoutMode={DetailsListLayoutMode.fixedColumns }
            isHeaderVisible={true}
            selection={this._selection}
            enterModalSelectionOnTouch={false}
            onRenderDetailsHeader={
              // tslint:disable-next-line:jsx-no-lambda
              (detailsHeaderProps: IDetailsHeaderProps, defaultRender: IRenderFunction<IDetailsHeaderProps>) => (
                <Sticky>
                  {defaultRender(detailsHeaderProps)}
                </Sticky>
              ) }
               />
</ScrollablePane>

prabirshrestha avatar Jun 11 '18 18:06 prabirshrestha