Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add freezed columns feature. #43

Closed
mbrn opened this issue Sep 13, 2018 · 23 comments
Closed

Add freezed columns feature. #43

mbrn opened this issue Sep 13, 2018 · 23 comments
Assignees
Labels
enhancement New feature or request In Progress I started to work on this

Comments

@mbrn
Copy link
Owner

mbrn commented Sep 13, 2018

Add freezed columns feature.

@mbrn mbrn added the enhancement New feature or request label Sep 13, 2018
@mbrn mbrn self-assigned this Sep 13, 2018
@mbrn mbrn added this to the v1.4.0 milestone Oct 25, 2018
@urirahimi
Copy link

Ideally freezed columns would work as they do in this demo https://devexpress.github.io/devextreme-reactive/react/grid/demos/featured/tree-data/

Where it has a fixed initial width and allows the user to drag/adjust after it is rendered

@mbrn mbrn removed this from the v1.4.0 milestone Mar 13, 2019
@mbrn
Copy link
Owner Author

mbrn commented Mar 18, 2019

no need for now.

@mbrn mbrn closed this as completed Mar 18, 2019
@revskill10
Copy link

This is useful feature to have , @mbrn when will it be landed ?

@mbrn
Copy link
Owner Author

mbrn commented Mar 23, 2019

I opened this issue on the first days of material-table. But i am only one developer of material-table and it is my hobby project. So i can not promise a date about issues. But as you know, i resolve issues, add features day by day :)

@mbrn mbrn reopened this Mar 23, 2019
@revskill10
Copy link

revskill10 commented Mar 23, 2019

@mbrn The intended behaviour is ability to freeze header, footer, columns on the right, columns on the left. This is nessessary when our table has about 30 columns.
In my use case, i have a table with columns like day1, day2,...day31 for a month, so i want to unfreeze those columns, and freeze other columns like first_name, last_name

@mbrn Yup, i think most of serious projects started as a hobby project ;)

@mbrn
Copy link
Owner Author

mbrn commented Mar 23, 2019

You are right. I will add this feature asap.

@krunalsheth3
Copy link

+1 to this request.

@feleko
Copy link

feleko commented May 16, 2019

+1 to this request

1 similar comment
@MaxGorshkov
Copy link

+1 to this request

@JKrymarys
Copy link

+1 :)

@JKrymarys
Copy link

@ALL
Any workarounds in the meantime?

@ysmike
Copy link

ysmike commented Aug 1, 2019

+1 to this request

@PrincAm
Copy link

PrincAm commented Aug 6, 2019

+1 as well :)

@yagofrancia
Copy link

+1

@joshling1919
Copy link

joshling1919 commented Sep 5, 2019

For anyone who needs a quick fix (not sure how good of a solution this is for all browsers), this codepen was a helpful example for how to implement this through CSS: https://codepen.io/paulobrien/pen/LBrMxa

Applying what the codepen did:

 const columns = [
    {
      title: 'Name',
      field: 'fullname',
      cellStyle: {
        backgroundColor: '#039be5',
        color: '#FFF',
        position: 'sticky',
        left: 0
      },
      headerStyle: {
        backgroundColor: '#039be5',
        position: 'sticky',
        left: 0,
        zIndex: 11
      }
    }
  ];
const Table = () => {
  return(
    <MaterialTable
        columns={columns}
        data={data}
        title={`Demo Title`}
        options={{
          headerStyle: {
            backgroundColor: '#01579b',
            color: '#FFF',
            position: 'sticky',
            top: 0
          }
        }}
    />
  );
}

@philg74
Copy link

philg74 commented Dec 13, 2019

+1 to this request.

2 similar comments
@nisarg271
Copy link

+1 to this request.

@NickAlvesX
Copy link

+1 to this request.

@mbrn mbrn added the In Progress I started to work on this label Jan 25, 2020
@mbrn
Copy link
Owner Author

mbrn commented Jan 27, 2020

Hi,

I researched about this feature to find a effective way. Found a solution:

Drawing table twice and one will be absolute. But i have to make table-layout fixed when table has freezed columns.

Please check datatables solution. And give me your feedback.
https://datatables.net/extensions/fixedcolumns/examples/initialisation/two_columns.html

@gabriel-kohen-by
Copy link

@mbrn , what you had shown in the link is exactly the functionality folks are looking for.
I think that if you want to have also freeze columns on the right(maybe v2), you can work as well. You just put the dynamic table in the middle with the correct width and on the left and right of the dynamic tables you can show the frozen columns.

@codenamethanos
Copy link

Yes, the solution you mentioned is perfect. An option prop like this will do -

fixedColumns:   {
            leftColumns: 2
}

@mbrn
Copy link
Owner Author

mbrn commented Feb 5, 2020

This is done with 1.57.1

Please check the documentation: https://material-table.com/#/docs/features/fixed-columns

@mbrn mbrn closed this as completed Feb 5, 2020
@vdh
Copy link

vdh commented Apr 20, 2020

@mbrn Why did you hard-code a width onto every column now, even when we're not using this feature? It's even ahead of the this.props.headerStyle and columnDef.headerStyle spreads, so there's no way to fix it when it breaks a custom width style 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request In Progress I started to work on this
Projects
None yet
Development

No branches or pull requests