Skip to content

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented May 21, 2021

@vercel
Copy link

vercel bot commented May 21, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/table/39oAB5YKd2obUNV7wd2Ft8u2zFqV
✅ Preview: https://table-git-fix-summary-react-component.vercel.app

@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #618 (0a05d46) into master (3899381) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 0a05d46 differs from pull request most recent head 2f5e6a7. Consider uploading reports for the commit 2f5e6a7 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #618   +/-   ##
=======================================
  Coverage   99.75%   99.76%           
=======================================
  Files          26       27    +1     
  Lines         817      850   +33     
  Branches      231      256   +25     
=======================================
+ Hits          815      848   +33     
  Misses          2        2           
Impacted Files Coverage Δ
src/Header/Header.tsx 100.00% <ø> (ø)
src/FixedHolder/index.tsx 100.00% <100.00%> (ø)
src/Footer/Cell.tsx 100.00% <100.00%> (ø)
src/Footer/Row.tsx 100.00% <100.00%> (ø)
src/Footer/Summary.tsx 100.00% <100.00%> (ø)
src/Footer/index.tsx 100.00% <100.00%> (ø)
src/Table.tsx 100.00% <100.00%> (ø)
src/hooks/useSticky.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3899381...2f5e6a7. Read the comment docs.

@zombieJ zombieJ merged commit 3a70f59 into master May 24, 2021
@zombieJ zombieJ deleted the fix-summary branch May 24, 2021 02:09
@hemengke1997
Copy link
Contributor

yo,终于更新了啊! 牛逼牛逼

@flyingcrp
Copy link

Nice work

@pierre-b
Copy link

Thanks for the merge guys!!

@flyingcrp
Copy link

need upgrade document

@hemengke1997
Copy link
Contributor

@flyingcrp
Copy link

need upgrade document

https://table-git-fix-summary-react-component.vercel.app/demo/sticky-header-and-summary

it's not work . im sure i got the "antd": "^4.16.0",
my code like this :


const TableSummary = ({columns, data, isSelect}) => {
    if (!Object.keys(data).length) return null;
    return (
        <Summary fixed >
            <Summary.Row>
                {isSelect && <Summary.Cell key={'selected-clm'} />}
                {columns.map((clm, idx) => {
                    if (idx === 0) {
                        return (
                            <Summary.Cell key={clm.dataIndex}>合</Summary.Cell>
                        );
                    }
                    if (!clm.children || !clm.children.length) {
                        return (
                            <Summary.Cell key={clm.dataIndex} align={clm.align}>
                                <ParseClm clm={clm} data={data} />
                            </Summary.Cell>
                        );
                    } else {
                        return clm.children.map((row) => {
                            return (
                                <Summary.Cell
                                    key={row.dataIndex}
                                    align={row.align}
                                >
                                    <ParseClm clm={row} data={data} />
                                </Summary.Cell>
                            );
                        });
                    }
                })}
            </Summary.Row>
        </Summary>
    );
};
export default TableSummary;


@hemengke1997
Copy link
Contributor

need upgrade document

https://table-git-fix-summary-react-component.vercel.app/demo/sticky-header-and-summary

it's not work . im sure i got the "antd": "^4.16.0",
my code like this :


const TableSummary = ({columns, data, isSelect}) => {
    if (!Object.keys(data).length) return null;
    return (
        <Summary fixed >
            <Summary.Row>
                {isSelect && <Summary.Cell key={'selected-clm'} />}
                {columns.map((clm, idx) => {
                    if (idx === 0) {
                        return (
                            <Summary.Cell key={clm.dataIndex}>合</Summary.Cell>
                        );
                    }
                    if (!clm.children || !clm.children.length) {
                        return (
                            <Summary.Cell key={clm.dataIndex} align={clm.align}>
                                <ParseClm clm={clm} data={data} />
                            </Summary.Cell>
                        );
                    } else {
                        return clm.children.map((row) => {
                            return (
                                <Summary.Cell
                                    key={row.dataIndex}
                                    align={row.align}
                                >
                                    <ParseClm clm={row} data={data} />
                                </Summary.Cell>
                            );
                        });
                    }
                })}
            </Summary.Row>
        </Summary>
    );
};
export default TableSummary;

what's wrong?

I used the nearly code and there is no error

@flyingcrp
Copy link

need upgrade document

https://table-git-fix-summary-react-component.vercel.app/demo/sticky-header-and-summary

it's not work . im sure i got the "antd": "^4.16.0",
my code like this :


const TableSummary = ({columns, data, isSelect}) => {
    if (!Object.keys(data).length) return null;
    return (
        <Summary fixed >
            <Summary.Row>
                {isSelect && <Summary.Cell key={'selected-clm'} />}
                {columns.map((clm, idx) => {
                    if (idx === 0) {
                        return (
                            <Summary.Cell key={clm.dataIndex}>合</Summary.Cell>
                        );
                    }
                    if (!clm.children || !clm.children.length) {
                        return (
                            <Summary.Cell key={clm.dataIndex} align={clm.align}>
                                <ParseClm clm={clm} data={data} />
                            </Summary.Cell>
                        );
                    } else {
                        return clm.children.map((row) => {
                            return (
                                <Summary.Cell
                                    key={row.dataIndex}
                                    align={row.align}
                                >
                                    <ParseClm clm={row} data={data} />
                                </Summary.Cell>
                            );
                        });
                    }
                })}
            </Summary.Row>
        </Summary>
    );
};
export default TableSummary;

what's wrong?

I used the nearly code and there is no error

yeah, ther is no error ,but .the summary row is also not stickied
so i dont know how to config it to showlike this merge

@hemengke1997
Copy link
Contributor

yeah, ther is no error ,but .the summary row is also not stickied
so i dont know how to config it to showlike this merge

allright, me too. maybe there is something we missed

@hemengke1997
Copy link
Contributor

动画5

@flyingcrp this is workable

@flyingcrp
Copy link

动画5

@flyingcrp this is workable

wow, is my code wrong?
let me see your code ,thanks

@hemengke1997
Copy link
Contributor

wow, is my code wrong?
let me see your code ,thanks

just like the example

summary={() => (
  <Table.Summary fixed={true}>
    <Table.Summary.Row>
      <Table.Summary.Cell index={0} />
      <Table.Summary.Cell index={1} colSpan={2}>
        Summary
      </Table.Summary.Cell>
      <Table.Summary.Cell index={3} colSpan={8}>
        Content
      </Table.Summary.Cell>
      <Table.Summary.Cell index={11} colSpan={2}>
        Right
      </Table.Summary.Cell>
    </Table.Summary.Row>
  </Table.Summary>
)}

@hemengke1997
Copy link
Contributor

wow, is my code wrong?
let me see your code ,thanks

maybe u should restart ur server after upgrade antd

@qyuja
Copy link

qyuja commented May 25, 2021

有办法把summary放到tbody上面固定吗

@miristein
Copy link

miristein commented Jun 22, 2021

I had the same problem - adding index to each cell was the solution.

() => (
<Table.Summary fixed={true}>
    <Table.Summary.Row>
        <Table.Summary.Cell index={0}>
            <Typography.Text strong={true}>First pilot column</Typography.Text>
        </Table.Summary.Cell>
        <Table.Summary.Cell index={1}>
            Content
        </Table.Summary.Cell>
        <Table.Summary.Cell index={2}>
            Content
        </Table.Summary.Cell>
    </Table.Summary.Row>
    <Table.Summary.Row>
        <Table.Summary.Cell index={0}>
            <Typography.Text strong={true}>Second pilot column</Typography.Text>
        </Table.Summary.Cell>
        <Table.Summary.Cell index={1}>
            Content
        </Table.Summary.Cell>
        <Table.Summary.Cell index={2}>
            Content
        </Table.Summary.Cell>
    </Table.Summary.Row>
</Table.Summary>
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to make Table Summary Fixed Row like Table Header

6 participants