/
tokentocpdb.js
43 lines (37 loc) · 1.31 KB
/
tokentocpdb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$(document).ready(function(){
function addtoCPDB(token_id)
{
$("#addcpdb").load(postUrl, {
participantid:token_id},function(){
$(location).attr('href',attMapUrl+'/'+survey_id);
});
//$("#processing").load(addtocpdbUrl, { tokenid:token_id,surveyid:survey_id,attributeid:survey_id }, function(msg){alert(msg);
//$(this).dialog("close");
//});
}
$('#addtocpdb').click(function()
{
var dialog_buttons={};
var token = [];
var token = jQuery('#displaytokens').jqGrid('getGridParam','selarrrow');
if(token.length==0)
{ /* build an array containing the various button functions */
/* Needed because it's the only way to label a button with a variable */
dialog_buttons[okBtn]=function(){
$( this ).dialog( "close" );
};
/* End of building array for button functions */
$('#norowselected').dialog({
modal: true,
buttons: dialog_buttons
});
}
else
{
addtoCPDB(token);
}
/*$(":checked").each(function() {
token.push($(this).attr('name'));
});*/
});
});