React+antd

1, clipboard.png
2
clipboard.png
3 how to use antd table components in react development to click on the child row to get the data of the parent row

Mar.31,2022

there is a method for onExpand to listen for opening subtable events. The parameter contains the current record, and you can maintain a current open subtable item in state. But in this case, it will be a problem if you can open more than one at the same time. I don't know which one you are operating. Another approach that I can think of is to associate the child table with the data of the parent table at the DataSource level. For example:

const ParentData = [
    {id: 1, name: 'demo', age: 20},
    {id: 2, name: 'smile', age: 30}
];

const childData = [
    [
        {
            parentId: 1,
            name: 'demo_friend1'
        },
        {
            parentId: 1,
            name: 'demo_friend2'
        }
    ],
     [
        {
            parentId: 2,
            name: 'smile_friend1'
        },
        {
            parentId: 2,
            name: 'smiel_friend2'
        }
    ]
]

this makes it easy to operate.
that's all I can think of right now!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea9827-1f5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea9827-1f5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?