-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathHeaderCell.jsx
More file actions
40 lines (36 loc) · 1.14 KB
/
Copy pathHeaderCell.jsx
File metadata and controls
40 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from "react";
const HeaderCell = ({ column, tableManager }) => {
const {
config: {
additionalProps: { headerCell: additionalProps = {} },
components: { SearchColumn },
searchByColumn,
},
searchApi: { setColumnSearchText },
} = tableManager;
let classNames = (
"rgt-text-truncate " + (additionalProps.className || "")
).trim();
return (
<div className="rgt-cell-header-content-container">
<span
{...additionalProps}
className={classNames}
data-column-id={column.id.toString()}
>
{column.label}
</span>
{searchByColumn && column.searchable && (
<SearchColumn
tableManager={tableManager}
name={`search-column-${column.field}`}
value={column.searchText}
onChange={(value) =>
setColumnSearchText(column.field, value)
}
/>
)}
</div>
);
};
export default HeaderCell;