简体   繁体   English

TYPO3 TCA selectMultipleSideBySide删除可用的项目

[英]TYPO3 TCA selectMultipleSideBySide removes available items

I want to create a TCA with selectMultipleSideBySide renderType and save the selected items in a column (maybe the uids?) 我想使用selectMultipleSideBySide renderType创建一个TCA并将所选项目保存在列中(也许是uid?)

What I expect: Click on an available item -> it moves to the left side to the selecteted items. 我的期望:单击一个可用的项目->它移至所选项目的左侧。 Select another available item -> it appears also on the left side. 选择另一个可用的项目->它也出现在左侧。 If I delete a selected item -> it moves back to the available items. 如果我删除选定的项目->,它将移回到可用项目。

What I get: Select a available item -> it moves to selected items. 我得到的是:选择一个可用的项目->它将移至选定的项目。 Select another available item -> it appears on selected items BUT the item before disappears on both sides. 选择另一个可用项目->它会出现在所选项目上,但该项目在两侧都消失之前。

My TCA: 我的TCA:

    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', array(
        'tx_vend_items' => array(
            'exclude' => 1,
            'label' => 'Items',
            'l10n_mode' => 'exclude',
            'config' => array(
                'type' => 'select',
                'size' => 5,
                'renderType' => 'selectMultipleSideBySide',
                'enableMultiSelectFilterTextfield' => true,
                'itemsProcFunc' => \Vend\Ext\Hooks\Backend\Preview\Renderer::class . '->getTest',
            )
        ),
    ));

getTest() getTest()

    public function getTest(&$pa)
    {
        for ($i = 0; $i < 10; $i++) {
            $pa['items'][] = [
                "Var: " . $i,
                1 * $i,
            ];
        }
    }

Did I miss something? 我错过了什么? Also to save the selected items 也保存选择的项目

I added 我加了

 'minitems' => 0,
 'maxitems' => 99999,

to my TCA and now it works 到我的TCA,现在可以使用了

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

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