dmag
dmag

I need to load dropdown options for a column of my DataTable and the documentation says the following:

options - for dropdown and autocomplete columns only - this specifies the AJAX handler that will return the available options, as an array. https://octobercms.com/docs/backend/forms#widget-datatable

I'm not sure how to specify the Ajax handler to load the dropdown options. Here's what I have in my fields.yaml for this widget:

field_name:
  type: datatable
  columns:
    name:
      type: dropdown
      title: Name
      options: # -> how to specify the Ajax handler here?

Last updated

mjauvin
mjauvin

just set options: value to the method name in your model that will generate the dropdown options (e.g. getMyOptions)

1-2 of 2