diff --git a/productMods/css/visualization/entitycomparison/layout.css b/productMods/css/visualization/entitycomparison/layout.css index fc37079f..bd0b5915 100644 --- a/productMods/css/visualization/entitycomparison/layout.css +++ b/productMods/css/visualization/entitycomparison/layout.css @@ -31,6 +31,12 @@ button{ float:right; } +#reset-search { + color: #2485AE; + cursor: pointer; + margin-left: 10px; +} + form{ margin-top:70px; margin-bottom: -50px; diff --git a/productMods/js/visualization/entitycomparison/util.js b/productMods/js/visualization/entitycomparison/util.js index f461022a..3952ff34 100644 --- a/productMods/js/visualization/entitycomparison/util.js +++ b/productMods/js/visualization/entitycomparison/util.js @@ -765,8 +765,10 @@ function prepareTableForDataTablePagination(jsonData){ table.append(tbody); tableDiv.append(table); - $('#datatable').dataTable({ - "sDom": '<"searchbar"f><"paginatedtabs"p><"datatablewrapper"t>', + var searchBarParentContainerDIVClass = "searchbar"; + + var entityListTable = $('#datatable').dataTable({ + "sDom": '<"' + searchBarParentContainerDIVClass + '"f><"paginatedtabs"p><"datatablewrapper"t>', "aaSorting" : [[2, "desc"]], "iDisplayLength": 10, "sPaginationType": "full_numbers", @@ -775,11 +777,18 @@ function prepareTableForDataTablePagination(jsonData){ $('tr>td:nth-child(1)>input').bind('click', function () { $(this).parent().parent().children().each(function(){$(this).addClass('datatablerowhighlight');}); }); $('tr>td:nth-child(1)>input').bind('click', function () { if(!$(this).is(':checked')) { $(this).parent().parent().children().each(function(){$(this).removeClass('datatablerowhighlight');});} }); } - + // "bLengthChange": false, // "bAutoWidth": false }); + var searchInputBox = $("." + searchBarParentContainerDIVClass).find("input[type=text]"); + + searchInputBox.after("X"); + + $("#reset-search").live('click', function() { + entityListTable.fnFilter(""); + }); bindPaginatedTabsToEvents(); @@ -837,18 +846,22 @@ function setEntityLevel(){ } function getEntityVisMode(jsonData){ - $.each(jsonData, function(index, val){ + + $.each(jsonData, function(index, val) { if (val.visMode == "SCHOOL" || val.visMode == "UNIVERSITY" || val.visMode == "DEPARTMENT"){ entityLevel = "Organizations"; - }else { + } else { entityLevel = "People"; } return; }); + + /* To provide graceful degradation set entity level to a default error message.*/ + entityElevel = "ENTITY LEVEL UNDEFINED ERROR"; } function toCamelCase(string){ - return (string.substr(0,1).toUpperCase() + string.substr(1, string.length-1).toLowerCase()); + return string ? (string.substr(0,1).toUpperCase() + string.substr(1, string.length-1).toLowerCase()) : ""; } function getSize(map){