WebContent/js/explore/spaces.js
/**
 * Initializes the DataTable objects and adds multi-select to them
 */
Initializes the DataTable objects and adds multi-select to them
Initializes the DataTable objects and adds multi - select to them
function initDataTables() {
	extendDataTableFunctions();
	var dataTableConfig = new window.star.DataTableConfig({
		"bServerSide": true,
		"sAjaxSource": starexecRoot + "services/space/",
		"fnServerData": fnPaginationHandler 
	});
	var dataTableConfigNoSort = new window.star.DataTableConfig({
		"bServerSide": true,
		"sAjaxSource": starexecRoot + "services/space/",
		"fnServerData": fnPaginationHandler, 
		"aaSorting": [] 
	});
	userTable = $('#users').dataTable(dataTableConfig);
	solverTable = $('#solvers').dataTable(dataTableConfig);
	benchTable = $('#benchmarks').dataTable(dataTableConfig);
	spaceTable = $('#spaces').dataTable(dataTableConfig);
	jobTable = $('#jobs').dataTable(dataTableConfigNoSort);
	setSortTable(benchTable);
	$("#benchmarks thead").click(function() {
		resetSortButtons();
	});
	var tables = ["#users", "#solvers", "#benchmarks", "#jobs", "#spaces"];
	function unselectAll(except) {
		var tables = ["#users", "#solvers", "#benchmarks", "#jobs", "#spaces"];
		for (x = 0; x < 6; x++) {
			if (except == tables[x]) {
				continue;
			}
			$(tables[x]).find("tr").removeClass("row_selected");
		}
	}
	for (x = 0; x < 6; x++) {
		$(tables[x]).on("mousedown", "tr", function() {
			unselectAll("#" + $(this).parent().parent().attr("id"));
			$(this).toggleClass("row_selected");
		});
	}
	$('#users tbody').on('hover', 'tr', function() {
		$(this).toggleClass('hovered');
	});
	$('.selectAllJobs, .selectAllSolvers, .selectAllBenchmarks, .selectAllUsers')
	.click(function() {
		$(this)
		.parents('.dataTables_wrapper')
		.find('tbody>tr')
		.addClass('row_selected');
	});
	$('.unselectAllJobs, .unselectAllSolvers, .unselectAllBenchmarks, .unselectAllUsers')
	.click(function() {
		$(this)
		.parents('.dataTables_wrapper')
		.find('tbody>tr')
		.removeClass('row_selected');
	});
	$('fieldset.expd').expandable(true);
	var advancedActionsCollapsed = $.cookie('advancedActions') != 'false';
	$('fieldset.advancedActions')
	.expandable(advancedActionsCollapsed)
	.children('legend:first')
	.click(function() {
		var advancedActionsCollapsed = !$(this).data('open');
		$.cookie('advancedActions',
			advancedActionsCollapsed,
			{expires: 10000, path: '/'});
	});
	jobTable.fnFilterOnDoneTyping();
	solverTable.fnFilterOnDoneTyping();
	benchTable.fnFilterOnDoneTyping();
	userTable.fnFilterOnDoneTyping();
	spaceTable.fnFilterOnDoneTyping();
	log('all datatables initialized');
}
function initDataTables ( ) { extendDataTableFunctions ( ) ; var dataTableConfig = new window . star . DataTableConfig ( { "bServerSide" : true , "sAjaxSource" : starexecRoot + "services/space/" , "fnServerData" : fnPaginationHandler } ) ; var dataTableConfigNoSort = new window . star . DataTableConfig ( { "bServerSide" : true , "sAjaxSource" : starexecRoot + "services/space/" , "fnServerData" : fnPaginationHandler , "aaSorting" : [ ] } ) ; userTable = $ ( '#users' ) . dataTable ( dataTableConfig ) ; solverTable = $ ( '#solvers' ) . dataTable ( dataTableConfig ) ; benchTable = $ ( '#benchmarks' ) . dataTable ( dataTableConfig ) ; spaceTable = $ ( '#spaces' ) . dataTable ( dataTableConfig ) ; jobTable = $ ( '#jobs' ) . dataTable ( dataTableConfigNoSort ) ; setSortTable ( benchTable ) ; $ ( "#benchmarks thead" ) . click ( function ( ) { resetSortButtons ( ) ; } ) ; var tables = [ "#users" , "#solvers" , "#benchmarks" , "#jobs" , "#spaces" ] ; function unselectAll ( except ) { var tables = [ "#users" , "#solvers" , "#benchmarks" , "#jobs" , "#spaces" ] ; for ( x = 0 ; x < 6 ; x ++ ) { if ( except == tables [ x ] ) { continue ; } $ ( tables [ x ] ) . find ( "tr" ) . removeClass ( "row_selected" ) ; } } for ( x = 0 ; x < 6 ; x ++ ) { $ ( tables [ x ] ) . on ( "mousedown" , "tr" , function ( ) { unselectAll ( "#" + $ ( this ) . parent ( ) . parent ( ) . attr ( "id" ) ) ; $ ( this ) . toggleClass ( "row_selected" ) ; } ) ; } $ ( '#users tbody' ) . on ( 'hover' , 'tr' , function ( ) { $ ( this ) . toggleClass ( 'hovered' ) ; } ) ; $ ( '.selectAllJobs, .selectAllSolvers, .selectAllBenchmarks, .selectAllUsers' ) . click ( function ( ) { $ ( this ) . parents ( '.dataTables_wrapper' ) . find ( 'tbody>tr' ) . addClass ( 'row_selected' ) ; } ) ; $ ( '.unselectAllJobs, .unselectAllSolvers, .unselectAllBenchmarks, .unselectAllUsers' ) . click ( function ( ) { $ ( this ) . parents ( '.dataTables_wrapper' ) . find ( 'tbody>tr' ) . removeClass ( 'row_selected' ) ; } ) ; $ ( 'fieldset.expd' ) . expandable ( true ) ; var advancedActionsCollapsed = $ . cookie ( 'advancedActions' ) != 'false' ; $ ( 'fieldset.advancedActions' ) . expandable ( advancedActionsCollapsed ) . children ( 'legend:first' ) . click ( function ( ) { var advancedActionsCollapsed = ! $ ( this ) . data ( 'open' ) ; $ . cookie ( 'advancedActions' , advancedActionsCollapsed , { expires : 10000 , path : '/' } ) ; } ) ; jobTable . fnFilterOnDoneTyping ( ) ; solverTable . fnFilterOnDoneTyping ( ) ; benchTable . fnFilterOnDoneTyping ( ) ; userTable . fnFilterOnDoneTyping ( ) ; spaceTable . fnFilterOnDoneTyping ( ) ; log ( 'all datatables initialized' ) ; }
Initializes the DataTable objects and adds multi-select to them
Initializes the DataTable objects and adds multi - select to them
// Extend the DataTables api and add our custom features
 // included in this file
 // included in this file
 // tells server to sort by 'created'
 // Setup the DataTable objects
 // Setup user permission tooltip
 //Hook up select all/ none buttons
 // Set all fieldsets as expandable (except for action fieldset)
 // Set the DataTable filters to only query the server when the user finishes typing
