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.

List.js need to strip anchor tag from items (column)

See original GitHub issue

Here 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:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
tousif786commented, Dec 26, 2017

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>

0reactions
ctf0commented, Dec 26, 2017

@tousif786 focken legend 🏆

Read more comments on GitHub >

github_iconTop 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 >

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