Can I add select/option data type to field type in apostrophe cm widget?

Viewed 194

I have a column widget that I'm trying to create a prepopulated dropdown list that a user can choose from that will correspond to a value of bootstrap class names "col-md-6" etc.

addFields: [
    {
      type: 'select',
      name: 'column1width',
      label: 'Column 1 Width',
      contextual: false,
      options: {
         name: '1 column',
         value: 'col-md-1'
       },
       {
         name: '2 column',
         value: 'col-md-2'
       }
    },
1 Answers

I figured out the answer

  type: 'select',
      name: 'column1width',
      label: 'Column 1 Width',
      contextual: false,
      choices: [
        {
          label: '1 Column',
          value: 'col-md-1'
        },
        {
          label: '2 Column',
          value: 'col-md-2'
        }
      ]
Related