我如何实现Modal Pop UP或Simple Pop Up或其他。
我在React中有一个GridView,请参见:My Grid
如何添加一个弹出的包含图像的附加列?
我有个主意,可能是单击或连续两次单击会触发triger或一个简单的列
我是反应的初学者
先谢谢您
您可以在react表中使用Cell。单击“ first_name”列时,您需要打开模式。
function getColumns(data) {
const columns = [];
const sample = data[0];
Object.keys(sample).forEach(key => {
if (key !== "_id" && key !== "first_name") {
columns.push({
accessor: key,Header: key
});
} else if(key === "first_name"){
columns.push({
accessor: key,Header: key
Cell: (rowInfo) => {
// call your modal toggle function here
// rowInfo contains data of that row. console and see what you can pass that in your function.
}
});
}
});
return columns;
}