OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Bootstrap-Table Custom Search

  • Thread starter Thread starter Jana
  • Start date Start date
J

Jana

Guest
I have a custom search that looks like this, but how can I use it in all columns and not just colName column?

https://live.bootstrap-table.com/code/janttila/5112

Code:
function customSearch(data, text) {
    return data.filter(function (row) {

        return  row.colName.toLowerCase().replace(/\s/g, "").indexOf(text.toLowerCase().replace(/\s/g, "")) > -1

    })
  }

<p>I have a custom search that looks like this, but how can I use it
in all columns and not just colName column?</p>
<p><a href="https://live.bootstrap-table.com/code/janttila/5112" rel="nofollow noreferrer">https://live.bootstrap-table.com/code/janttila/5112</a></p>
<pre><code>function customSearch(data, text) {
return data.filter(function (row) {

return row.colName.toLowerCase().replace(/\s/g, "").indexOf(text.toLowerCase().replace(/\s/g, "")) > -1

})
}
</code></pre>
 

Latest posts

Top