<html>
<head>
<link rel="stylesheet" type="text/css" href="//qtip2.com/v/2.2.0/jquery.qtip.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://qtip2.com/v/2.2.0/jquery.qtip.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('body').prepend('> '+getTime()+' <hr />');
//var someVar = "abc123";
var schedulerQTipMarkup = "<input data-orderprocedureid='12375895' value='ABC' type='radio' name='testChk' id='testChk1' /> <label for='testChk1'>12375895</label><br><input data-orderprocedureid='48651238' value='DEF' type='radio' name='testChk' id='testChk2' /> <label for='testChk2'>48651238</label>";
$("#myTestTable").find("a.cwfAssociateLink").each(function(){
$(this).click(function(){
//$('td.fc-widget-content').qtip('destroy');
var targetObj = this;
$(this).qtip({
content: {
text: schedulerQTipMarkup,
title: {
text: 'Select Procedure',
button: true,
},
},
events: {
show: function (event, api) {
api.elements.tooltip.find("input[name='testChk']").each(function(index, element){
$(element).click(function(e){
api.elements.target.html($(this).data("orderprocedureid"));
$(api.elements.target).closest("tr").attr("data-orderprocedureid",$(this).data("orderprocedureid"));
api.destroy();
})
})
}
},
show: {
event: 'click',
modal: false,
solo: true //true
},
hide: 'unfocus'
}).qtip('show');
}); //end click definition
});//end find each
$("#acceptCWFSelections").click(function(){
var allVerified = true;
$(".schedulerCWFRowCheck:checked").each(function(){
var orderProcedureId = $(this).closest("tr").data("orderprocedureid");
if(orderProcedureId == null){
alert("Pick a procedure");
$(this).closest("tr").addClass("highlightCWFRow");
allVerified = false;
}else{
$(this).closest("tr").removeClass("highlightCWFRow");
alert(orderProcedureId);
}
})
return false;
});
$("#createCWFSelections").click(function(){
$(".schedulerCWFRowCheck:checked").closest('tr[data-orderprocedureid]').each(function(){
alert($(this).data("orderprocedureid"));
});
});
}); //end document ready
function getTime(e) {
var dd = new Date();
var hh = dd.getHours();
var mm = dd.getMinutes();
var ss = dd.getSeconds();
var now = ''+hh+':'+mm+':'+ss;
return now;
}
</script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
.blub{
margin-top:20px; width:220px; border:1px solid red;
}
.cwfTable{
border: 1px solid #000;
}
.cwfTable td{
border: 1px solid #000;
}
.highlightCWFRow{
background-color: yellow;
}
</style>
</head>
<body>
<div id="blubContainer">
<table id="myTestTable" class="cwfTable">
<tr>
<td><input class="schedulerCWFRowCheck" type="checkbox" /></td>
<td><a href="#" class="cwfAssociateLink">Click to Associate</a></td>
<td>Data 1.3</td>
<td>Data 1.4</td>
<td>Data 1.5</td>
<td>Data 1.6</td>
<td>Data 1.7</td>
</tr>
<tr>
<td><input class="schedulerCWFRowCheck" type="checkbox" /></td>
<td><a href="#" class="cwfAssociateLink">Click to Associate</a></td>
<td>Data 2.3</td>
<td>Data 2.4</td>
<td>Data 2.5</td>
<td>Data 2.6</td>
<td>Data 2.7</td>
</tr>
<tr>
<td><input class="schedulerCWFRowCheck" type="checkbox" /></td>
<td><a href="#" class="cwfAssociateLink">Click to Associate</a></td>
<td>Data 3.3</td>
<td>Data 3.4</td>
<td>Data 3.5</td>
<td>Data 3.6</td>
<td>Data 3.7</td>
</tr>
</table>
</div>
Hello, world!
<br>
<button id="acceptCWFSelections">Submit</button>
<button id="createCWFSelections">Create</button>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |