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:
+10
-14
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user