question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap filter control doesn't working correctly for cells with hyperlinks?

See original GitHub issue

Please view the example. I have a cell created like this.

<td> 
 <a href="https://www.google.com" target="_blank">
  3 (10.0 %)
 </a>
</td>

Now, in above cell actual data value is 3 (10.0 %) but when I type “google” in filter box it shows the cell with value 3 (10.0 %) which means it is taking whole hyperlink tag as cell value.

How i can achieve the correct filtering behavior for cells with hyperlinks ? May be I am following wrong approach for inserting hyperlink in table cell ? Any help or hint will be much appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
wenzhixincommented, Jun 6, 2019

In the example provided, the problem is that the value of the cell is indeed:

<a href="https://www.google.com" target="_blank">
  3 (10.0 %)
</a>

I think we can use formatter and searchFormatter column options to solve the problem:

1reaction
drhossacommented, Mar 11, 2020

I have a similar issue like @dvhassel! In my case I have to be able to filter on cell contents which may have HTML-Tags included. The rows have to be filterable by select. <strong>foo</strong> bar <i>foo</i> bar <a href="#">foo</a> bar By default the whole string will be taken by the select. A filtering leads to no results

@dvhassel I created a possible solution. If you create an object and pass it to the using the data-filter-data pattern it seems to work properly. http://jsfiddle.net/yd5wo8ha/

I will now try try to find a way matching my case as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table filter control with cell content having links <a> is no ...
Experienced this issue today. Worked around issue with filterData and passing a list of options. I did do enough investigating to find that...
Read more >
bootstrap table: filter control not working - Stack Overflow
In my case, filter-control was not working due to data-height. I removed data-height and it worked. Share. Share a link to this answer....
Read more >
CSS · Bootstrap
Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap...
Read more >
Components - Bootstrap
Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
Read more >
Migrating to v5 - Bootstrap
Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found