[BUGFIX] Do not load ExtJS again via AJAX 80/42080/4
authorMarkus Klein <markus.klein@typo3.org>
Wed, 29 Jul 2015 00:07:58 +0000 (02:07 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 29 Jul 2015 14:17:45 +0000 (16:17 +0200)
Resolves: #68396
Releases: master
Change-Id: I8ccdcd6466b3367503ae7c8385015f7e34994b4f
Reviewed-on: http://review.typo3.org/42080
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php

index f72c414..b64b99c 100644 (file)
@@ -169,10 +169,10 @@ class SelectTreeElement extends AbstractFormElement {
                }
                /** @var $pageRenderer PageRenderer */
                $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
-               $pageRenderer->loadExtJs();
                $pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/tree.js');
                $pageRenderer->addInlineLanguageLabelFile(ExtensionManagementUtility::extPath('lang') . 'locallang_csh_corebe.xlf', 'tcatree');
-               $pageRenderer->addExtOnReadyCode('
+               $pageRenderer->addJsInlineCode('treefoo','
+               Ext.onReady(function() {
                        TYPO3.Components.Tree.StandardTreeItemData["' . $id . '"] = ' . $treeData . ';
                        var tree' . $id . ' = new TYPO3.Components.Tree.StandardTree({
                                id: "' . $id . '",
@@ -229,7 +229,7 @@ class SelectTreeElement extends AbstractFormElement {
                        'window.setTimeout(function() {
                                tree' . $id . '.render("tree_' . $id . '");
                        }, 200);
-               ');
+               });');
                $formField = '
                        <div class="typo3-tceforms-tree">
                                <input class="treeRecord" type="hidden" name="' . htmlspecialchars($PA['itemFormElName']) . '" id="treeinput' . $id . '" value="' . htmlspecialchars($PA['itemFormElValue']) . '" />