fix: [genericElement:indexTable] Ignore row selector column
parent
64fdd4d290
commit
7940920f3d
|
@ -21,9 +21,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (!empty($header['element']) && $header['element'] === 'selector') {
|
||||||
|
$columnName = 'row-selector';
|
||||||
|
} else {
|
||||||
|
$columnName = h(\Cake\Utility\Inflector::variable(!empty($header['name']) ? $header['name'] : \Cake\Utility\Inflector::humanize($header['data_path'])));
|
||||||
|
}
|
||||||
$headersHtml .= sprintf(
|
$headersHtml .= sprintf(
|
||||||
'<th scope="col" data-columnname="%s">%s</th>',
|
'<th scope="col" data-columnname="%s">%s</th>',
|
||||||
h(\Cake\Utility\Inflector::variable(!empty($header['name']) ? $header['name'] : \Cake\Utility\Inflector::humanize($header['data_path']))),
|
$columnName,
|
||||||
$header_data
|
$header_data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ $tableSettings['hidden_column'] = $tableSettings['hidden_column'] ?? [];
|
||||||
$availableColumnsHtml = '';
|
$availableColumnsHtml = '';
|
||||||
$availableColumns = [];
|
$availableColumns = [];
|
||||||
foreach ($table_data['fields'] as $field) {
|
foreach ($table_data['fields'] as $field) {
|
||||||
|
if (!empty($field['element']) && $field['element'] === 'selector') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$fieldName = !empty($field['name']) ? $field['name'] : \Cake\Utility\Inflector::humanize($field['data_path']);
|
$fieldName = !empty($field['name']) ? $field['name'] : \Cake\Utility\Inflector::humanize($field['data_path']);
|
||||||
$isVisible = !in_array(h(\Cake\Utility\Inflector::variable($fieldName)), $tableSettings['hidden_column']);
|
$isVisible = !in_array(h(\Cake\Utility\Inflector::variable($fieldName)), $tableSettings['hidden_column']);
|
||||||
$availableColumns[] = $fieldName;
|
$availableColumns[] = $fieldName;
|
||||||
|
|
Loading…
Reference in New Issue