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

Editable select (editable_select) bug or there is no option for allow null ? #5380

Closed
AdamovicBoban opened this issue Nov 24, 2023 · 4 comments
Assignees

Comments

@AdamovicBoban
Copy link

I'm trying to set up an editable select in listOperation to accept null, but it's not working. I've tried allow_null, default, and hint, but none of these are working. Is this a bug, or is there no option for allowing null?

	CRUD::addColumn([
            'name'    => 'driver_id',
            'label'   => 'Driver',
            'type'    => 'editable_select',
      //      'placeholder' => "Select user",
      //      'default' => null,
      //      'allow_null' => true,
            'options' => (function ($entry) {
                return \App\Models\User::drivers()->pluck('first_name', 'id')->toArray();
        }),
            'underlined'       => true,
            'save_on_focusout' => true,
            'save_on_change'   => true,
            'on_error' => [
                'text_color'          => '#df4759',
                'text_color_duration' => 0,
                'text_value_undo'     => false,
            ],
            'on_success' => [
                'text_color'          => '#42ba96',
                'text_color_duration' => 3000,
            ],
            'auto_update_row' => true,
        ]);
### PHP VERSION:
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies
    with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans

### LARAVEL VERSION:
10.33.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.2
backpack/crud: 6.3.0
backpack/devtools: 3.0.2
backpack/editable-columns: 3.0.2
backpack/generators: v4.0.2
backpack/permissionmanager: 7.1.1
backpack/pro: 2.0.18
backpack/settings: 3.1.0
backpack/theme-coreuiv2: 1.2.2
backpack/theme-coreuiv4: 1.1.1
backpack/theme-tabler: 1.1.1
Copy link

welcome bot commented Nov 24, 2023

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;
  • Showing off something you've made, asking for opinion on Backpack/Laravel matters - Reddit;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

@pxpm
Copy link
Contributor

pxpm commented Nov 29, 2023

Hey, @AdamovicBoban this is on my plate.

I just haven't got the time to get to it yet. Sorry 😞

During this week I will get back here and try to figure out what's happening.

Thanks for the report, and sorry for the delay.

Cheers

@AdamovicBoban
Copy link
Author

Hey, @AdamovicBoban this is on my plate.

I just haven't got the time to get to it yet. Sorry 😞

During this week I will get back here and try to figure out what's happening.

Thanks for the report, and sorry for the delay.

Cheers

Hey @pxpm Which week? or year? 😏

@pxpm
Copy link
Contributor

pxpm commented Jan 18, 2024

Hey @AdamovicBoban sorry again, thanks for the ping.

There is no built in functionality for a placeholder/null option, but you can just add it yourself as an option:

        'options' => (function ($entry) {
                return array_merge(['' => 'Select an option'],\App\Models\User::drivers()->pluck('first_name', 'id')->toArray());
        }),

Hope it helps. 🙏

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

No branches or pull requests

2 participants