Skip to content

Commit

Permalink
[CHANGED] optimize demo
Browse files Browse the repository at this point in the history
  • Loading branch information
qili.taoqili committed Jul 18, 2019
1 parent 0f432eb commit be23290
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
75 changes: 41 additions & 34 deletions demo/GridDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,45 +380,52 @@ class Demo extends React.Component {
},
onToggleSubComp: (isOpen, rowData, table) => {
setTimeout(() => {
rowData.customContent = rowData.firstName
rowData.customContent = {
data: [
{
id: `${rowData.id}-${setTimeout(0)}`, class: rowData.firstName, dep: '用户体验平台', person: '张三'
},
{
id: `${rowData.id}-${setTimeout(0)}`, class: rowData.firstName, dep: '用户体验平台', person: '李思'
},
{
id: `${rowData.id}-${setTimeout(0)}`, class: rowData.firstName, dep: '用户体验平台', person: '王武'
}
]
}
isOpen && table.updateRow(rowData)
}, 1000)
}, 100)
},
renderSubComp: (rowData) => {
const subProps = {
jsxcolumns: [
{
dataKey: 'id',
title: '序号',
},
{
dataKey: 'class',
title: '分类',
width: '200px',
},
{
dataKey: 'dep',
title: '部门',
width: '200px',
},
{
dataKey: 'person',
title: '采购员',
width: '200px',
},
],
className: 'kuma-uxtable-ghost',
};
return (
<div>
{rowData.customContent ? rowData.customContent : 'loading'}
<div style={{ padding: '0 24px', background: 'rgba(31,56,88,0.04)' }}>
<Table {...subProps} jsxdata={rowData.customContent || {data: []}} />
</div>
)
// const subProps = {
// jsxcolumns: [
// {
// dataKey: 'id',
// title: '序号',
// },
// {
// dataKey: 'class',
// title: '分类',
// width: '200px',
// },
// {
// dataKey: 'dep',
// title: '部门',
// width: '200px',
// },
// {
// dataKey: 'person',
// title: '采购员',
// width: '200px',
// },
// ],
// className: 'kuma-uxtable-ghost',
// };
// return (
// <div style={{ padding: '0 24px', background: 'rgba(31,56,88,0.04)' }}>
// <Table {...subProps} jsxdata={rowData.subCompData} />
// </div>
// );
);
},
};
return (
Expand Down
4 changes: 2 additions & 2 deletions demo/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"check": true,
"id": "1",
"grade": "grade1",
"email": "email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1email1",
"email": "email",
"firstName": "firstName1",
"lastName": "lastName1",
"birthDate": "birthDate1",
Expand Down Expand Up @@ -244,4 +244,4 @@
"success": true,
"errorCode": "",
"errorMsg": ""
}
}

0 comments on commit be23290

Please sign in to comment.