autocomplete 检查器类型的工作方式与 string 编辑器类似,不同之处在于它包含自动完成功能。可用选项可以通过 options 参数静态指定,或动态加载。
public function defineProperties()
{
return [
'condition' => [
'title' => 'Condition',
'type' => 'autocomplete',
'options' => ['start' => 'Start', 'end' => 'End']
]
];
}生成的输出是一个数组值,对应于所选选项,例如:
"condition": "start"以下 配置值 是常用的。
| Property | Description |
|---|---|
| title | title for the property. |
| description | a brief description of the property, optional. |
| default | specifies a default string value, optional. |
| options | array of options for dropdown properties, optional if defining a get*PropertyName*Options method. |
| showExternalParam | unsupported, and should be set to false. |
此类型不支持由
showExternalParam属性所指定的外部参数编辑器。
The autocomplete 检查器类型支持与 下拉检查器类型 相同的定义选项的方法。
public function defineProperties()
{
return [
'sortColumn' => [
'title' => 'Sort by Column',
'type' => 'autocomplete',
// ...
],
];
}
public function getSortColumnOptions()
{
return [
'create' => 'Create',
'update' => 'Update',
'delete' => 'Delete',
];
}