简体   繁体   English

TCA建议向导与选择字段(并排)

[英]TCA Suggest Wizard with select field (side by side)

In a TYPO3 8.7 Backend / TCA, I'm trying to add a suggest wizard to a select field of the type selectMultipleSideBySide . 在TYPO3 8.7后端/ TCA中,我试图将建议向导添加到selectMultipleSideBySide类型的选择字段中。

There are already two other wizards, add and edit, which work, while suggest doesn't. 已经有另外两个向导,即添加和编辑,它们可以工作,而建议不起作用。

'genres' => [
            'exclude' => false,
            'label' => 'Genres',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_myext_domain_model_genre',
                'MM' => 'tx_myext_project_genre_mm',
                'size' => 10,
                'autoSizeMax' => 30,
                'maxitems' => 9999,
                'multiple' => 0,
                'wizards' => [
                    '_PADDING' => 1,
                    '_VERTICAL' => 1,
                    'edit' => [
                        'module' => [
                            'name' => 'wizard_edit',
                        ],
                        'type' => 'popup',
                        'title' => 'Edit', 
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif',
                        'popup_onlyOpenIfSelected' => 1,
                        'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
                    ],
                    'add' => [
                        'module' => [
                            'name' => 'wizard_add',
                        ],
                        'type' => 'script',
                        'title' => 'Create new',
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif',
                        'params' => [
                            'table' => 'tx_myext_domain_model_genre',
                            'pid' => '###CURRENT_PID###',
                            'setValue' => 'prepend'
                        ],
                    ],
                    'suggest' => [
                        'type' => 'suggest',
                        'tx_myext_domain_model_genre' => [
                            'maxItemsInResultList' => 25,
                        ],
                        'default' => [
                            'searchWholePhrase' => 1
                        ]
                    ],
                ],
            ],
        ],

I admit I got the code for the suggest wizard from a group field (where it works). 我承认我是从组字段中获得建议向导的代码的(在此起作用)。 But I need the side by side view in the backend, not the group view. 但是我需要在后端并排查看,而不是组视图。

What I now get is 我现在得到的是

在此处输入图片说明

But I'd like a search box on top of it. 但我想在其顶部有一个搜索框。 Where can I find some example code? 在哪里可以找到示例代码?

Turns out what I wanted is not the a wizard at all! 原来我想要的根本不是向导! But a so called MultiSelectFilterTextfield 但是所谓的MultiSelectFilterTextfield

Simply adding 'enableMultiSelectFilterTextfield' => true, to config did the trick, so 只需在配置中添加'enableMultiSelectFilterTextfield' => true,就可以了,所以

'genres' => [
            'exclude' => false,
            'label' => 'Genres',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_myext_domain_model_genre',
                'MM' => 'tx_myext_project_genre_mm',
                'size' => 10,
                'autoSizeMax' => 30,
                'maxitems' => 9999,
                'multiple' => 0,
                'enableMultiSelectFilterTextfield' => true, // <---- HERE
                'wizards' => [
                    '_PADDING' => 1,
                    '_VERTICAL' => 1,
                    'edit' => [
                        'module' => [
                            'name' => 'wizard_edit',
                        ],
                        'type' => 'popup',
                        'title' => 'Edit', 
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif',
                        'popup_onlyOpenIfSelected' => 1,
                        'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
                    ],
                    'add' => [
                        'module' => [
                            'name' => 'wizard_add',
                        ],
                        'type' => 'script',
                        'title' => 'Create new',
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif',
                        'params' => [
                            'table' => 'tx_myext_domain_model_genre',
                            'pid' => '###CURRENT_PID###',
                            'setValue' => 'prepend'
                        ],
                    ],
                ],
            ],
        ],

Will produce 会产生

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM