react-component / react-component/table
onCell, onHeaderCell not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 618
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 2
Description
rc-table version: 7.7.2
issue 1:
onCell={(record, index) => {
return {
onClick: () => {
console.log('click');
},
};
}}
onHeaderCell={(column) => {
return {
onClick: () => {
console.log('click');
},
};
}}
I add those code to the Table components, but i can't see the click output.
issue 2:
If i customize the table components, like bellow, then i add some customize property
const SelfCell= (props: any) => {
console.log(props);
return <th {...props} />;
};
const components = {
header: {
cell: SelfCell,
},
body: {
cell: SelfCell,
},
};
onCell={(record, index) => {
return {
test: index
};
}}
onHeaderCell={(column) => {
return {
test: column
};
}}
After the cell renderd, I can't see the 'test' property be output in the props.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how onCell and onHeaderCell are handled when rendering header and body cells, then compare that path with the custom components example. Verify the click handlers are attached and that returned properties such as test reach SelfCell props; the issue is resolved when both behaviors work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100