最佳答案
如果您使用 JSON 输入,则需要为您的列定义自定义 id
。
示例:
const grid = new Grid({
columns: [{
id: 'name',
name: 'Name'
}, {
id: 'email',
name: 'Email'
}, {
id: 'phoneNumber',
name: 'Phone Number'
}],
data: [
{ name: 'John', email: '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b1dbded9dff1d4c9d0dcc1ddd49fd2dedc" rel="noreferrer noopener nofollow">[email protected]</a>', phoneNumber: '(353) 01 222 3333' },
{ name: 'Mark', email: '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e333f2c351e39333f3732703d3133" rel="noreferrer noopener nofollow">[email protected]</a>', phoneNumber: '(01) 22 888 4444' },
]
});
关于reactjs - 与 React js 集成时,列不使用 Gridjs 显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65564699/