JSFiddle - React, Tailwind, and code Playground
by Harisankaran Parameswaran
HTML
<table class="docs_table" id="myTable2">
<tr id="node-22" class="disabled_element">
<td title="Document is being edited by someone.">
<input type="checkbox" name="docs" id="/root/docname" value="/root/docname" disabled />
</td></tr>
<tr id="node-23" class="child">
<td title="">
<input type="checkbox" name="docs" id="/root/docname2" value="/root/docname2" />
</td></tr>
<tr id="node-22" class="disabled_element">
<td title="Document is being edited by someone.">
<input type="checkbox" name="docs" id="/root/docname3" value="/root/docname3" disabled />
</td></tr>
JavaScript
$(document).ready(function(){
$('table tr td input[type="checkbox"]').each(function () {
if ($( this ).prop('disabled')) {
$( this ).closest('tr').addClass('lineThrough');
var valStr = $(this).val();
$( this ).closest('td').attr('onClick', 'clickFn("'+valStr+'");');
console.log($( this ).closest('td').attr('onClick'));
}});
});
function clickFn(valStr){
if(confirm('Press OK to confirm')){
valStr = valStr.substring(valStr.lastIndexOf('/') + 1);
newHref = '/pathtoscript?command=dosomething&name=' +valStr;
console.log(newHref);
document.location = newHref;
}
}