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
feat: renderFooterInTable
toggle to render footer as <tfoot />
#191
Conversation
examples/renderFooterInTable.js
Outdated
return <Cell key={key || dataIndex}>{text}</Cell> | ||
}) | ||
|
||
return <Row>{cells}</Row> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is returning <Row />
required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. Only when you set renderFooterInTable
to true should you return <Row />
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep the original footer
API untouched. Pass extra args to it, but only takes effect when you toggle renderFooterInTable
on.
I only intent to provide a way to put the footer right inside the table's As of |
@yesmeck Any feedback? |
src/FootTable.js
Outdated
style={footStyle} | ||
onScroll={handleBodyScrollLeft} | ||
> | ||
<BaseTable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why render tfoot
to a separator BaseTable
, can we just render it in the BaseTable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason is to keep its behavior consistent to Header's. When you turn { scroll: y }
on, Header is fixed, most likely user want the Footer to be fixed too.
Hmm, I didn't notice there's hover state syncing in there...🤔 Lemme check. |
Could you consider the proposal I wrote in ant-design/ant-design#5710 (comment) |
I see. Actually, I don't think there should be any hover state on footer at all. Current behavior is simply an side effect of css |
换中文吧?我同意你的这个 API 加入方式更好些。我会改成用这个来实现。 除了这点,现在的这个 fixed footer 的实现你有什么要 comment 的吗? |
另外我建议命名为 |
就叫 “footer” 好了,我们也没有把 “row” 叫 “tr”。 |
ok,命名你们定。 |
其他看起来 ok |
又考虑了下, const columns = [{
title: 'Price',
footer: `Amount: ${amount}`,
}] |
@hackape 这个功能咋样呀 |
这段时间忙就给放下了,我今明两天应该能提个新的上来。 |
@hackape column footer 这个是否 可以在antd table 里面使用? |
@xgj1988 这个 PR 被 revert 掉了,所以现在没有这功能。官方建议用自定义的 |
@hackape 用哪个也有问题。 https://codesandbox.io/s/xjpkx9rzzw 这是别人的demo 。这里有两个问题。 |
@xgj1988 不是让你直接用这个 demo 的实现,这只是给你提供一个可行思路。现在的情况就是官方团队不想增加 table 的复杂度,这种高级用法需要你自己去实现,而相应的接口就是 |
打印需要用到tfoot,官方却没有这种打印需求。 |
@leejaen 你也可以尝试提一个完善的 PR |
No description provided.