Fixes issue where nested columns forcibly hide

Eg: "myrelation[attribute]" as a column name would cause the list setup to hide these fields with no ability to bring them back
This commit is contained in:
Samuel Georges 2016-12-14 19:14:41 +11:00
parent 7731f37aac
commit c644f8b66d
3 changed files with 6 additions and 9 deletions

View File

@ -117,10 +117,7 @@ class WidgetManager
* Usage:
* <pre>
* WidgetManager::registerFormWidgets(function($manager){
* $manager->registerFormWidget('Backend\FormWidgets\CodeEditor', [
* 'name' => 'Code editor',
* 'code' => 'codeeditor'
* ]);
* $manager->registerFormWidget('Backend\FormWidgets\CodeEditor', 'codeeditor');
* });
* </pre>
*/

View File

@ -1312,7 +1312,7 @@ class Lists extends WidgetBase
public function onApplySetup()
{
if (($visibleColumns = post('visible_columns')) && is_array($visibleColumns)) {
$this->columnOverride = array_keys($visibleColumns);
$this->columnOverride = $visibleColumns;
$this->putSession('visible', $this->columnOverride);
}

View File

@ -14,11 +14,11 @@
<input
type="hidden"
name="column_order[]"
value="<?= $column->columnName ?>" />
value="<?= e($column->columnName) ?>" />
<input
id="<?= $this->getId('setupCheckbox-'.$column->columnName) ?>"
name="visible_columns[<?= $column->columnName ?>]"
value="1"
name="visible_columns[]"
value="<?= e($column->columnName) ?>"
<?= $column->invisible ? '' : 'checked="checked"' ?>
type="checkbox" />
<label
@ -63,4 +63,4 @@
<?= e(trans('backend::lang.form.cancel')) ?>
</button>
</div>
<?= Form::close() ?>
<?= Form::close() ?>