问题描述
我需要帮助将格式化的数据包含到搜索功能中。由于某种原因,搜索中不包含格式化的链接
function docFormatter(cell,row,rowIndex) {
return (
<a href={${row.doc.doclink}}>
{row.doc.docname}
);
}
const columns = [
{ datafield: "sno",text: "S.No" },{
datafield: "doc",text: "Document Name",formatter: docFormatter,filterValue: docFormatter,},];
我有一个客户格式化程序,它返回带有文本的锚标记。搜索对此不起作用。
...,{
datafield: 'type',text: 'Job Type',formatter: (cell,row) => types[cell],filterValue: (cell,row) => types[cell] // we will search the value after filterValue called
}
我不了解如何通过引用此方法来实现它。请帮我。谢谢
解决方法
这是解决此问题的工作模型
{{1}},
我遇到了同样的问题,但找不到解决方案。
function docFormatterFilter(cell,row) {
return row.nom;
}
export const fieldsUser = [
{
dataField: 'id',sort:true,text: '',formatter: (cell,row) => {
return (
<div className={`flex-grow-1`}>
<div className="d-flex align-items-center justify-content-between">
<h4 className="m-0">{row.nom}</h4>
<small className={ `role-groupe text-center ${row.role==='s' ? 'bg-danger' : row.role==='a'?'bg-success':'bg-primary'}` }>{row.role_label}</small>
</div>
</div>
)},filterValue: (cell,row) => docFormatterFilter(cell,row),filter: textFilter({
caseSensitive: false,comparator: Comparator.LIKE,}),classes: 'col-12',}
];
一周后没有任何效果。