MDL-69336 lib: Reinstating tablelib column show/hide functionality

Also added behat testing for hide/show columns in participants table.
This commit is contained in:
Michael Hawkins
2020-08-04 15:20:29 +08:00
parent 95c4f624c8
commit 52925cb9df
2 changed files with 59 additions and 14 deletions
+10 -14
View File
@@ -1444,23 +1444,19 @@ class flexible_table {
}
}
// Now, update the column attributes for collapsed columns
foreach (array_keys($this->columns) as $column) {
if (!empty($this->prefs['collapse'][$column])) {
$this->column_style[$column]['width'] = '10px';
}
}
// Now, update the column attributes for collapsed columns
foreach (array_keys($this->columns) as $column) {
if (!empty($this->prefs['collapse'][$column])) {
$this->column_style[$column]['width'] = '10px';
}
}
$this->set_hide_show_preferences();
$this->set_sorting_preferences();
$this->set_initials_preferences();
// Now, reduce the width of collapsed columns and remove the width from columns that should be expanded.
foreach (array_keys($this->columns) as $column) {
if (!empty($this->prefs['collapse'][$column])) {
$this->column_style[$column]['width'] = '10px';
} else {
unset($this->column_style[$column]['width']);
}
}
if (empty($this->baseurl)) {
debugging('You should set baseurl when using flexible_table.');
global $PAGE;