-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🧐[问题]ProTable中如何实现二级表单(children)列之间的拖拽排序 #7021
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
demo 例子https://codesandbox.io/s/tuo-zhuai-pai-xu-forked-ciyfqe?file=/App.tsx |
问题解决方案在 ProTable 中实现含有 children 层级的表头固定操作,可以使用 import React from "react";
import ProTable, { ProColumns } from "@ant-design/pro-table";
const columns: ProColumns<any>[] = [
{
title: "名称",
dataIndex: "name",
width: 200,
fixed: "left",
},
{
title: "年龄",
dataIndex: "age",
width: 100,
fixed: "left",
},
{
title: "描述",
dataIndex: "description",
width: 200,
children: [
{ title: "身高", dataIndex: "height", width: 100 },
{ title: "体重", dataIndex: "weight", width: 100 },
],
},
];
const data = [
{
key: "1",
name: "John Brown",
age: 32,
description: {
height: 180,
weight: 75,
},
},
// ...
];
const DemoTable: React.FC = () => {
return (
<ProTable<any>
columns={columns}
dataSource={data}
scroll={{ x: "max-content" }}
headerTitle="示例表格"
search={false}
options={false}
pagination={false}
toolBarRender={false}
bordered
sticky={true}
/>
);
};
export default DemoTable; 在示例代码中,我们将 "名称" 和 "年龄" 列设置为固定左侧,而含有 children 层级的 "描述" 列则需要进行自定义渲染。在 ProTable 中,可以使用 此外,我们还需要设置 希望这个解决方案能够帮助到你,如果有任何疑问,请随时告诉我。 |
提问前先看看:
https://codesandbox.io/s/tuo-zhuai-pai-xu-forked-ciyfqe?file=/App.tsx
🧐 问题描述
请问在proTable的字段设置弹窗中,如何实现二级表单(children)列之间的拖拽排序
十分感谢你的帮助
🚑 其他信息
The text was updated successfully, but these errors were encountered: