List.js need to strip anchor tag from items (column)
See original GitHub issueHere is the sample of html code
HTML
<table class='sticky-list'>
<thead>
<tr>
<th class='sort header-company-name' data-sort='sort-0'>Company Name</th>
<th class='sort header-phone-number' data-sort='sort-1'>Phone Number</th>
<th class='sort header-website' data-sort='sort-2'>Website</th>
<th class='sort header-email' data-sort='sort-3'>Email</th>
</tr>
</thead>
<tbody class='list'>
<tr class='odd'>
<td class='sort-0 stickylist-text'><a href='http://example.com/?company_id=1010'>Testing company</a></td>
<td class='sort-1 stickylist-phone '></td><td class='sort-2 stickylist-text'></td>
<td class='sort-3 stickylist-text '></td>
</tr>
<tr class='even'>
<td class='sort-0 stickylist-text'><a href='http://example.com/company_id=999'>kljkl</a></td>
<td class='sort-1 stickylist-phone '></td>
<td class='sort-2 stickylist-text '></td>
<td class='sort-3 stickylist-text '></td>
</tr>
</tbody>
</table>
JS
<script>var options = { valueNames: ['sort-0','sort-1','sort-2','sort-3',] };var userList = new List('table_parent_box_id_here', options);</script>
Issue
While sorting it took column one (‘sort-0’) like this <a href='http://example.com/?company_id=1010'>Testing company</a>
and sort it accordingly, which wrong. I just need text like this this Testing company to sort. How can do that? Thanks in advance.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
javascript - How to hide an anchor tag and display another ...
Bootstrap buttons should preferably be used in their own element, try to wrap them inside another element which is then hidden by your...
Read more >How to Remove Hyperlink from Lookup Columns in SharePoint?
Go to your List view page, E.g. https://portal.crescent.com/Lists/ProjectMilestones/AllItems.aspx; Click on Site Settings gear, click on the “Edit Page” menu ...
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 >How to redirect to a particular section of a page using HTML or ...
Method 1: Using HTML: One can use the anchor tag to redirect to a particular section on the same page. You need to...
Read more >Using the HTML5 Drag and Drop API - web.dev
Then, in your JavaScript set up the event handlers, add the over class when the column is dragged over, and remove it when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I figure out the solution. You just need to place this class sort-0 on a correct html tag. So change this
<td class='sort-0 stickylist-text'><a href='http://example.com/?company_id=1010'>Testing company</a></td>
to
<td class='stickylist-text'><a class="sort-0" href='http://example.com/?company_id=1010'>Testing company</a></td>
@tousif786 focken legend 🏆