TYPO3 TCA forms using AJAX for drop down lists

主宰稳场 提交于 2019-12-06 11:45:40

You can use markers in your "foreign_table_where"-string. One of them is the ###REC_FIELD_[fieldname]### marker.

Example:

'campus' => array(
    'label' => 'campus',
    'config' => array(
        'type' => 'select'
    )
    'foreign_table' => 'tx_myext_domain_model_campus',
),
'department' => array(
    'label' => 'department',
    'config' => array(
        'type' => 'select'
    )
    'foreign_table' => 'tx_myext_domain_model_department',
    'foreign_table_where' => " AND tx_myext_domain_model_department.campus = '###REC_FIELD_campus###'"
)

Additionally you have to tell TCA that a change of your campus field requests an update.

In ext_tables.php:

$TCA['tx_myext_domain_model_example']['ctrl']['requestUpdate'] .= ',campus';
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!