/** * Render extjs combobox filter field * * @param \Engine\Crud\Grid\Filter\Field $field * @return string */ public static function _(Field\ArrayToSelect $field) { $fieldCode = []; $fieldCode[] = "xtype: 'combobox'"; $fieldCode[] = "name: '" . $field->getKey() . "'"; $label = $field->getLabel(); if ($label) { $fieldCode[] = "fieldLabel: '" . $label . "'"; } $desc = $field->getDesc(); if ($desc) { $fieldCode[] = "boxLabel: '" . $desc . "'"; } $width = $field->getWidth(); if ($width) { $fieldCode[] = "width: " . $width; } $fieldCode[] = "typeAhead: true"; $fieldCode[] = "triggerAction: 'all'"; $fieldCode[] = "selectOnTab: true"; $fieldCode[] = "lazyRender: true"; $fieldCode[] = "listClass: 'x-combo-list-small'"; $fieldCode[] = "queryMode: 'local'"; $fieldCode[] = "displayField: 'name'"; $fieldCode[] = "valueField: 'id'"; $fieldCode[] = "valueNotFoundText: 'Nothing found'"; $store = forward_static_call(['static', '_getStore'], $field); $fieldCode[] = "store: " . $store; return forward_static_call(['static', '_implode'], $fieldCode); }