I do have another customisation in userpriv (export options permissions), but it's not related in any way.
Actually, since my mods are implemented via an extension using args.code.replace(), I disabled the export permissions mod and regenerated both userpriv files to check for issues but the fixed header still worked fine.
All I can suggest at this point is that you post your edits (plus 2-3 lines of code before and after) - maybe I'll spot something in your implementation.
//*****
<?php
namespace PHPMaker2020\DFX_2020;
// Session
if (session_status() !== PHP_SESSION_ACTIVE)
session_start(); // Init session data
// Output buffering
ob_start();
// Autoload
include_once "autoload.php";
?>
<?php
// Write header
WriteHeader(FALSE);
// Create page object
$userpriv = new userpriv();
// Run the page
$userpriv->run();
// Setup login status
SetupLoginStatus();
SetClientVar("login", LoginStatus());
// Global Page Rendering event (in userfn*.php)
Page_Rendering();
// Page Rendering event
$userpriv->Page_Render();
?>
<?php include_once "header.php"; ?>
<scr ipt>
var fuserpriv, currentPageID;
loadjs.ready("head", function() {
// Form object
currentPageID = ew.PAGE_ID = "userpriv";
fuserpriv = currentForm = new ew.Form("fuserpriv", "userpriv");
loadjs.done("fuserpriv");
});
</scr ipt>
<?php if (file_exists('js/ewfixedheadertable.js')) { ?>
<scr ipt>
ew.ready("head", "js/ewfixedheadertable.js", "fixedheadertable");
</scr ipt>
<?php } ?>
<scr ipt>
loadjs.ready("head", function() {
// Client scr ipt
// Write your client scr ipt here, no need to add scr ipt tags.
});
</scr ipt>
<?php
$userpriv->showMessage();
?>
<form name="fuserpriv" id="fuserpriv" class="form-inline ew-form ew-user-priv-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($Page->CheckToken) { ?>
<in put type="hidden" name="<?php echo Config("TOKEN_NAME") ?>" value="<?php echo $Page->Token ?>">
<?php } ?>
<in put type="hidden" name="t" value="user_groups">
<in put type="hidden" name="action" id="action" value="update">
<in put type="hidden" name="x_User_Group_ID" id="x_User_Group_ID" value="<?php echo $userpriv->User_Group_ID->CurrentValue ?>">
<div class="ew-desktop">
<div class="card ew-card ew-user-priv">
<div class="card-header">
<h3 class="card-title"><?php echo $Language->phrase("UserLevel") ?><?php echo $Security->getUserLevelName((int)$userpriv->User_Group_ID->CurrentValue) ?> (<?php echo $userpriv->User_Group_ID->CurrentValue ?>)</h3>
<div class="card-tools">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-search"></i></span>
</div>
<in put type="search" name="table-name" id="table-name" class="form-control form-control-sm" placeholder="<?php echo HtmlEncode($Language->phrase("Search")) ?>">
</div>
</div>
</div>
<div class="<?php echo ResponsiveTableClass() ?>card-body ew-card-body p-0"></div>
</div>
<div class="ew-desktop-button">
<button class="btn btn-primary ew-btn" name="btn-submit" id="btn-submit" type="submit"<?php echo $userpriv->Disabled ?>><?php echo $Language->phrase("Update") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?php echo $userpriv->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
</div>
</div>
</form>
<scr ipt>
loadjs.ready("makerjs", function() {
var $ = jQuery,
priv = <?php echo JsonEncode($userpriv->Privileges) ?>;
function getDisplayFn(name, trueValue) {
return function(data) {
var row = data.record, id = name + '_' + row.index,
checked = (row.permission & trueValue) == trueValue;
row.checked = checked;
return '<div class="custom-control custom-checkbox d-inline-block"><in put type="checkbox" class="custom-control-input ew-priv ew-multi-select" name="' + id + '" id="' + id +
'" value="' + trueValue + '" data-index="' + row.index + '"' +
((checked) ? ' checked' : '') +
(((row.allowed & trueValue) != trueValue) ? ' disabled' : '') + '><label class="custom-control-label" for="' + id + '"></label></div>';
};
}
function displayTableName(data) {
var row = data.record;
return row.table + '<in put type="hidden" name="table_' + row.index + '" value="1">';
}
function getRecords(data, params) {
var rows = priv.permissions.slice(0);
if (data && data.table) {
var table = data.table.toLowerCase();
rows = jQuery.map(rows, function(row) {
if (row.table.toLowerCase().includes(table))
return row;
return null;
});
}
if (params && params.sorting) {
var asc = params.sorting.match(/ASC$/);
rows.sort(function(a, b) { // Case-insensitive
if (b.table.toLowerCase() > a.table.toLowerCase())
return (asc) ? -1 : 1;
else if (b.table.toLowerCase() === a.table.toLowerCase())
return 0
else if (b.table.toLowerCase() < a.table.toLowerCase())
return (asc) ? 1 : -1;
});
}
return {
result: "OK",
params: jQuery.extend({}, data, params),
records: rows
};
}
function getTitleHtml(id, phraseId) {
return '<div class="custom-control custom-checkbox"><in put type="checkbox" class="custom-control-input ew-priv" name="' + id + '" id="' + id + '" onclick="ew.selectAll(this);">' +
'<label class="custom-control-label" for="' + id + '">' + ew.language.phrase("Permission" + (phraseId || id)) + '</label></div>'
}
// Fields
var _fields = {
table: {
title: '<span class="font-weight-normal">' + ew.language.phrase("TableOrView") + '</span>',
display: displayTableName,
sorting: true
}
};
["add", "delete", "edit", "list", "lookup", "view", "search", "import", "admin"].forEach(function(id) {
_fields[id] = {
title: getTitleHtml(id),
display: getDisplayFn(id, priv[id]),
sorting: false
};
});
// Init
$(".ew-card.ew-user-priv .ew-card-body").ewjtable({
paging: false,
sorting: true,
defaultSorting: "table ASC",
fields: _fields,
actions: { listAction: getRecords },
rowInserted: function(event, data) {
var $row = data.row;
$row.find("input[type=checkbox]").on("click", function() {
var $this = $(this), index = parseInt($this.data("index"), 10), value = parseInt($this.data("value"), 10);
if (this.checked)
priv.permissions[index].permission = priv.permissions[index].permission | value;
else
priv.permissions[index].permission = priv.permissions[index].permission ^ value;
});
},
recordsLoaded: function(event, data) {
var sorting = data.serverResponse.params.sorting,
$c = $(this).find(".ewjtable-column-header-container:first");
if (!$c.find(".ew-table-header-sort")[0])
$c.append('<span class="ew-table-header-sort"><i class="fas fa-sort-down"></i></span>');
$c.find(".ew-table-header-sort i.fas").toggleClass("fa-sort-up", !!sorting.match(/ASC$/)).toggleClass("fa-sort-down", !!sorting.match(/DESC$/));
ew.initMultiSelectCheckboxes();
ew.fixLayoutHeight();
}
});
// Re-load records when user click 'Search' button.
var _timer;
$("#table-name").on("keydown keypress cut paste", function(e) {
if (_timer)
_timer.cancel();
_timer = $.later(200, null, function() {
$(".ew-card.ew-user-priv .ew-card-body").ewjtable("load", {
table: $("#table-name").val()
});
});
});
// Load all records
$("#table-name").keydown();
});
</scr ipt>
<scr ipt>
loadjs.ready("load", function() {
<?php if (file_exists('js/ewfixedheadertable.js')) { ?>
// Apply fixed header style to table
$('table').addClass('table-head-fixed ew-fixed-header-table');
<?php } ?>
// Startup scr ipt
// Write your startup scr ipt here
// console.log("page loaded");
});
</scr ipt>
<?php if (file_exists('js/ewfixedheadertable.js')) { ?>
<scr ipt>
loadjs.ready("fixedheadertable", function() {
ew.fixedHeaderTable({
delay: 0,
scrollbars: false,
container: "ewjtable-main-container",
width: "",
height: ""
});
});
</scr ipt>
<?php } ?>
<?php include_once "footer.php"; ?>
<?php
$userpriv->terminate();
?>