T
TanStack3y ago
fascinating-indigo

How to render default filters outside of the table in v8

In table v7 I used following code to render filters defined in columns outside of table headers: {headerGroup.headers.map((column) => ( column.enableFilter && ( <div className="col-md-2" key={column.id}> <div> <label className="form-label">{column.render('Header')}</label> {column.render('Filter', { setFilter })} </div> </div> ) ))} But I am migrating to v8 and I don't know how to do it. I put in column definition meta: filterComponent: (setFilterValue) => { ... return <Component/>} And render it like: if (header.column?.columnDef?.meta?.filterComponent) { return header.column?.columnDef?.meta?.filterComponent(); } but this is for custom filters how I can get default filter when just enableFilter is true? All I want is the same component that is rendered in table header to render the same outside of it without need to define it custom. I checked whole header object but can't find where component is.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?