Skip to content

Instantly share code, notes, and snippets.

@pgorod
Created October 10, 2017 14:59
Show Gist options
  • Save pgorod/46fe697624b20d537e34f697a4e17571 to your computer and use it in GitHub Desktop.
Save pgorod/46fe697624b20d537e34f697a4e17571 to your computer and use it in GitHub Desktop.
Fix "selected" in Listviews, SuiteR
jssource/src_files/include/javascript/sugar_3.js
Line 2432
sugarListView.prototype.toggleSelected = function () {
var numSelected = sugarListView.get_num_selected();
var selectedRecords = document.getElementById("selectedRecordsTop");
var selectActions = document.getElementById("selectActions");
var selectActionsDisabled = document.getElementById("selectActionsDisabled");
if (numSelected > 0) {
// $(selectedRecords).removeAttr("style").addClass("show");
$(".selectActionsDisabled").hide();
jQuery('ul[name=selectActions]').each(function () {
jQuery(this).removeAttr("style").addClass("show");
});
} else {
// $(selectedRecords).hide();
$(".selectActionsDisabled").removeAttr("style").addClass("show");
jQuery('ul[name=selectActions]').each(function () {
jQuery(this).hide();
});
}
}
include/ListView/ListViewDisplay.php
Line 434
function buildSelectedObjectsSpan($echo = true, $total=0) {
global $app_strings;
$displayStyle = $total > 0 ? "" : "display: table!important;"; // <--------------
$template = new Sugar_Smarty();
$template->assign('DISPLAY_STYLE', $displayStyle);
$template->assign('APP', $app_strings);
$template->assign('TOTAL_ITEMS_SELECTED', $total);
$selectedObjectSpan = $template->fetch('include/ListView/ListViewSelectObjects.tpl');
return $selectedObjectSpan;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment