Last active
September 5, 2017 05:54
-
-
Save suresh-kumara-gist/d977e5620872ec0dbf430be7e8942368 to your computer and use it in GitHub Desktop.
Jquery fetch table row and td text change it to link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("#time-report > tbody > tr.last-level").each(function( index ) { | |
| var text = $( this ).find("td.name").text(); | |
| // text will have "Support #20767: WG: Payment Transaction Failed Reminder " | |
| // pop() javascript function removes last element in a array | |
| // shift() javascript function removes first element in a array | |
| var issue_id = text.split('#').pop().split(':').shift(); | |
| var issuelink = $('<a href="/issues/' + issue_id + '" target="_blank">' + text + '</a>'); | |
| $( this ).find("td.name").html(issuelink); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment