How to add custom values to Editor Field Options

How to add custom values to Editor Field Options

mihalispmihalisp Posts: 127Questions: 22Answers: 0
edited May 2019 in Free community support

Hello, I have an Editor Field

    label: "Employee ID:",
            name: "employee_id",
            type: "select" ,         
            }, 

that pulls its values from

     Field::inst( 'db.employee_id' )
    ->options( Options::inst()
             ->table( 'Employees' )
             ->value( 'empl_id' )
              ->label( 'empl_descr' )
                  )
    ->validator( Validate::dbValues() ) ,

This returns a dropdown list with 5 rows.

I want with custom render to add 1 more row to this Field Options-dropdown list (e.g. "0" or "null","Front Desk").

I don't want to add this row to the db table.

Thank you in advance!

Answers

  • mihalispmihalisp Posts: 127Questions: 22Answers: 0

    Anyone here to help please?
    Allan, Colin, kthorngren ??

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    If its just a default option you want to add then the placeholder option of the select field type is the way to do this. If you want to make it selectable then placeholderDisabled can be set to false and placeholderValue can be used to define its value.

    Allan

This discussion has been closed.