// When document is ready jQuery(document).ready(function() { // Prepare for setup the datatable. var dataTableOptions = { "sAjaxSource": sAjaxSource, "fnInitComplete" : function() { initPageSelect(); }, "bAutoWidth": false, "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 14, 15 ] }, // turn off visibility { "sClass": "center", "aTargets": [ 6, 7, 8, 9, 12, 13 ] } ], "aoColumns": [ { "sWidth": "2%"}, // Id { "sWidth": "12%"}, // Title { "sWidth": "7%"}, // Short Name { "sWidth": "6%"}, // Script Type Name null, // Application Run Group Name { "sWidth": "9%"}, // Application Run Group Restriction Name { "sWidth": "7%"}, // Application Run Group Limit { "sWidth": "4%"}, // Enabled { "sWidth": "4%"}, // Enqueue Backlogs { "sWidth": "8%"}, // Run Time { "sWidth": "10%"}, // Last Queued At { "sWidth": "8%"}, // Affinities { "sWidth": "8%"}, // Prerequisites { "sWidth": "4%"}, // Actions null, null ], "fnServerData": function ( sSource, aoData, fnCallback ) { _.each(jQuery('.datatable_variable').serializeArray(), function(dv) { aoData.push(dv); }); jQuery.getJSON( sSource, aoData, function (json) { fnCallback(json); initPaging(); addTitles(); }); }, "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { addLinkToApplication(nRow, aData); colorizationDeletedOrHidden(nRow, aData); checkTimeFormat(nRow, aData); return nRow; }, "sDom": "Rlfrtip" }; // Setup the datatable jQuery('#datatable').addDataTable(dataTableOptions); jQuery(document).delegate('.enqueue', "click", function(){ var answer = confirm("Adding application as a job on the queue?"); if (!answer) { return false; } jQuery.post(postSource, { "historical_job[application_id]": jQuery(this).attr('id') }, function(data) { if (data.success) { jQuery("
Congratulations, a Job " + data.title + " was added!
"). appendTo('#flash_message').slideDown().delay(5000).slideUp(); jQuery('#datatable').dataTable().fnDraw(); } else { jQuery("