[TYPO3-english] typo3 v.4.7.4 and global scope

Florian Schaeffer florian.schaeffer at mercoline.de
Mon Sep 10 07:26:28 CEST 2012


Hello Jigal,

> In typo3/sysext/em/res/js/em_components.js lines 594-607 the selector is
> defined:
> TYPO3.EM.UploadLocationCombo = new Ext.form.ComboBox({
>
> This refers to TYPO3.EM.LocationStore for the available options. This is
> defined in the same file on lines 502-511:
> TYPO3.EM.LocationStore = new Ext.data.JsonStore({
>
> I tried to define a store (like in em_repositorylist.js lines 71... ),
> but couldn't make this work.
>
> I hope to have some time tonight to make a dummy store provider in PHP.
> If you can get the ExtJS stuff working the PHP part is very easy...

As I am more in ExtJS than in TYPO3 (development) just a quick shot:

The store by now is defined as
TYPO3.EM.LocationStore = new Ext.data.JsonStore({
         fields : ['name', 'value'],
         data   : [
                 {name : 'Local (../typo3conf/ext/)',   value: 'L'}
         ]
});

You will need to replace it by an Ext Direct Store which takes the 
ExtDirect.action as directFn. So there has to be a Ext direct definition 
(aka backend function) and this function has to be published _BEFORE_ 
you could use it in your store.

So lets say you have a directFn which responds to a request to

TYPO3.EM.ExtDirect.getInstallLocations

and contains a JSON-reponse with

{success: true, data: [
	['name':'Local', 'value':'L'] .... }

then your store definition would be

TYPO3.EM.LocationStore = new Ext.data.DirectStore({
	storeId: 'locations',
         idProperty: 'value',
         directFn: TYPO3.EM.ExtDirect.getInstallLocations,
         root: 'data',
         fields : ['name', 'value']
});

HTH
Florian




More information about the TYPO3-english mailing list