question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More Custom Column Header

See original GitHub issue

Thanks again for a great library. I’m interested in providing this feature and would submit a PR for it, but I think there might be API additions/changes in order to support this, so I thought I’d start with an issue.

Expected Behavior

What I would really like to be able to do is to create a header that acts as a filter as well as a sortable header. I have a basic implementation, done right now, but the filtering is not possible with the current customHeadRender feature. I need more access to more of the props from the MUIDataTable component.

I’m not really sure what the best way to achieve this is. One thought I had was to be able to allow the API to completely replace components. i.e. I could re-write my custom TableHead component and then inject it something like:

components = {
  'TableHead': <MyCustomTableHead />
}
<MuiDataTable components={components} data={data} columns={columns}/>

Again, what I really want to do is to be able to create a header for a column that is capable of filtering. However you think is best to achieve this, I’m open to implementing.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
loganasherjonescommented, Jan 12, 2019

Ok, I’ve done some work to make the column header that I wanted. Now I just need to figure out the best way to make this available.

Code

Code Comparison

Screenshots

This is all just proof-of-concept and works pretty well. I’d like to figure out how you’d like to see this added as a feature. Here are some screenshots of what the filtering looks like:

Dark Theme

No Filters No Sorting

dark_main

Sort ascending

dark_sort_asc

Sort descending

dark_sort_desc

Filter Active

dark_with_filter

Light Theme

No Filters No Sorting

light_main_view

Sort ascending

light_sort_asc

Sort descending

light_sort_desc

Filter Active

light_with_filter

1reaction
chupee120commented, Feb 26, 2019

Hello,

I will also need this feature.

Any chance to have a Pull Request soon?

Thanks,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up your header row - Microsoft Support
To rename the columns, double-click each column header and type the name you want or edit an existing one. To return the transformed...
Read more >
Solved: Re: Adding Custom Column Headers in Matrix visual
Note : We already tried adding Textbox on top of matrix to display the highlighted header but sometimes matrix visual have scroll bar...
Read more >
DT Shiny different custom column header by column
You can use the option headerCallback . datatable(head(iris, 10), container = sketch, options = list( headerCallback = JS( "function( thead, ...
Read more >
Customize Column Headers - DevExtreme - DevExpress
If you need a more specific customization, define a custom template in the columns.headerCellTemplate property. This property accepts a function or template ...
Read more >
JavaScript Data Grid Column headers - Handsontable
Use default column headers (A, B, C), or set them to custom values provided by an ... More complex data structures can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found