react-bootstrap-table2搜索不适用于格式化的单元格

问题描述

我需要帮助将格式化的数据包含到搜索功能中。由于某种原因,搜索中不包含格式化的链接

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,},];

我有一个客户格式化程序,它返回带有文本的锚标记搜索对此不起作用。

我查看了文档https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/basic-search.html#search-on-formatted-data

...,{
  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',}
];

一周后没有任何效果。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...