Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent field-display behaviour #293

Open
phptek opened this issue Jul 5, 2019 · 1 comment
Open

Inconsistent field-display behaviour #293

phptek opened this issue Jul 5, 2019 · 1 comment

Comments

@phptek
Copy link

phptek commented Jul 5, 2019

The main issue, is that I can display a field inline, and editing works OK, but I cannot get a field to show and show a GridField heading. I tried applying "CardState" into the relevant $summary_fields, which did nothing.

  • "CardState" is a ManyManyExtraField
  • DB is Postgres
  • silverstripe/framework 4.3.4
  • symbiote/silverstripe-gridfield-extensions 4.x-dev

  • [OK] Can see GridField heading
  • [OK] Can see DropdownField
  • [FAIL] DropdownField is populated
$componentEditableFields = (new GridFieldEditableColumns())
    ->setDisplayFields(['CardState' => [
        'title' => 'Heading',
        'field' => DropdownField::create('CardState', 'Card State', ['Foo','Bar'])
         )
    ]]);
$config->addComponent($componentEditableFields, GridFieldEditButton::class);
  • [OK] Can see GridField heading
  • [OK] Can see DropdownField
  • [FAIL] DropdownField is populated
$componentEditableFields = (new GridFieldEditableColumns())
    ->setDisplayFields(['CardState' => [
        'title' => 'Heading',
        'field' => DropdownField::create('CardState', 'Card State', [])
         )
    ]]);
$config->addComponent($componentEditableFields, GridFieldEditButton::class);
  • [FAIL] Can see GridField heading (Shows the FQCN of the DropdownField!?)
  • [OK] Can see DropdownField
  • [OK] DropdownField is populated
$componentEditableFields = (new GridFieldEditableColumns())
    ->setDisplayFields(['CardState' => DropdownField::class]);
$config->addComponent($componentEditableFields, GridFieldEditButton::class);
  • [FAIL] Can see GridField heading
  • [OK] Can see DropdownField
  • [OK] DropdownField is populated
  • [FAIL] DropdownField auto-displays possible ENUM values, not what's been passed into the constructor ala ['Foo','Bar'] (Yes, this may be "wrong", but it shoiuld still allow it)
$componentEditableFields = (new GridFieldEditableColumns())
    ->setDisplayFields(['CardState' => [
        'title' => 'Heading',
        'field' => DropdownField::create('CardState', 'Card State', ['Foo','Bar'])
         )
    ]]);
$config->addComponent($componentEditableFields, GridFieldEditButton::class);
  • [FAIL] Can see GridField heading
  • [OK] Can see DropdownField
  • [OK] DropdownField is populated
  • [FAIL] DropdownField is populated
$componentEditableFields = (new GridFieldEditableColumns())
    ->setDisplayFields(['CardState' => [
        'title' => 'Heading',
        'field' => DropdownField::class
         )
    ]]);
$config->addComponent($componentEditableFields, GridFieldEditButton::class);
@albanyacademy
Copy link

op did you try the callback method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants