diff --git a/modules/backend/formwidgets/DataGrid.php b/modules/backend/formwidgets/DataGrid.php index 267b30093..ff4f35f9e 100644 --- a/modules/backend/formwidgets/DataGrid.php +++ b/modules/backend/formwidgets/DataGrid.php @@ -79,9 +79,17 @@ class DataGrid extends FormWidgetBase return $grid; } + /** + * Looks at the model for getXXXAutocompleteValues or getGridAutocompleteValues methods + * to obtain values for autocomplete field types. + * @param string $field Grid field name + * @param string $value Current value + * @param string $data Data for the entire grid + * @return array + */ public function getAutocompleteValues($field, $value, $data) { - $methodName = 'get'.studly_case($this->columnName).'GridAutocompleteValues'; + $methodName = 'get'.studly_case($this->columnName).'AutocompleteValues'; if (!$this->model->methodExists($methodName) && !$this->model->methodExists('getGridAutocompleteValues')) throw new ApplicationException('Model :model does not contain a method getGridAutocompleteValues()'); @@ -97,7 +105,6 @@ class DataGrid extends FormWidgetBase return $result; } - public function getDataSourceValues() { if (!$this->model->methodExists('getGridDataSourceValues'))