[TYPO3-mvc] ExtJS, AJAX in Extbase

Stefan Isak stefanisak at googlemail.com
Mon Jan 24 14:50:51 CET 2011


Hey,

you can always have a look at the code itself. 
If you find something like <f:be.container /> and don't now what it actually is good for, just glance at fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php

There are different ways to handle XHR. 
Using my sample code, you can put an ExtJs ajax request in your MyScript.js:

// Basic request 
Ext.Ajax.request({    
	url: 'mod.php?M=web_MyextTxMyextM1&tx_myext_web_myexttxmyextm1[controller]=MyController&tx_myext_web_myexttxmyextm1[action]=index',    
	success: someFn,   
	failure: otherFn,    
	headers: { 'my-header': 'foo'  },    
	params: { foo: 'bar' } 
}); 

The response is exactly what your index action in MyController renders.

So long
Stefan


On 24.01.2011, at 14:26, Dawid Pacholczyk wrote:

> <f:be.container /> <--- now that is magick. I`ve lost 2 days to find a way to include extjs :) thank you very much. Where I can find some documentation to that ?
> 
> Now the second thing. I should now write functions in ExtJS ? How to handle Ajax and do some operation ? Can I add a record to database or something ?
> 
> Best regards,
> Dawid Pacholczyk
> 
> W dniu 2011-01-24 14:15, Stefan Isak pisze:
>> Hi,
>> 
>> you can create a backend layout in EXT:Resources/Private/Backend/Layouts/myLayout.html
>> 
>> Here is an example of myLayout.html:
>> 
>> 8<   8<   8<   8<   8<   8<   8<   8<   8<
>> <f:be.container pageTitle="MyTitle" loadExtJs="TRUE" loadExtJsTheme="TRUE">
>> 
>> <link href="{f:uri.resource(path:'Backend/Styles/MyStyles.css')}" rel="stylesheet" />
>>         <div class="typo3-fullDoc">
>>                 <div id="typo3-docheader">
>>                         <div id="typo3-docheader-row1">
>>                                 <div class="buttonsleft">
>>                                         <f:render section="iconButtons" />
>>                                 </div>
>>                                 <div class="buttonsright">
>>                                         <f:be.buttons.shortcut />
>>                                 </div>
>>                         </div>
>>                         <div id="typo3-docheader-row2">
>>                                 <div class="docheader-row2-left">
>>                                         <f:be.buttons.csh />
>>                                         <f:be.menus.actionMenu>
>>                                                 <f:be.menus.actionMenuItem label="Overview" controller="MyController" action="index" />
>>                                         </f:be.menus.actionMenu>
>>                                 </div>
>> 
>>                                 <div class="docheader-row2-right">
>>                                         <f:be.pagePath />
>>                                         <f:be.pageInfo />
>>                                 </div>
>>                         </div>
>>                 </div>
>>                 <div id="typo3-docbody">
>>                         <div id="typo3-inner-docbody">
>>                                 <f:renderFlashMessages class="tx-extbase-flash-message" />
>> 
>>                                 <f:render section="content" />
>> 
>>                                 <script src="{f:uri.resource(path:'Backend/JavaScript/MyScript.js')}" type="text/javascript"></script>
>>                         </div>
>>                 </div>
>>         </div>
>> </f:be.container>
>> 8<   8<   8<   8<   8<   8<   8<   8<   8<
>> 
>> Especially have a look at<f:be.container />. Using 4.4.x you may need to add loadExtJs="TRUE" and loadExtJsTheme="TRUE". AFAIK in TYPO3 4.5.x it's included per default.
>> 
>> Within your JS file you can use urls with the following scheme to make ajax calls:
>> mod.php?M=web_MyextTxMyextM1&tx_myext_web_myexttxmyextm1[controller]=MyController&tx_myext_web_myexttxmyextm1[action]=index
>> 
>> 'M1' in this url is according to your configuration in ext_tables.php>  Tx_Extbase_Utility_Extension::registerModule( ... )
>> 
>> Hope those things make it way easier for you.
>> 
>> So long
>> Stefan
>> 
>> On 24.01.2011, at 13:46, Dawid Pacholczyk wrote:
>> 
>>> Hi List !!
>>> I just can`t do it. How can I run extjs and ajax in my extbase BE module ? I`m looking at workspace and othere exts and nothing.
>>> 
>>> For example what is pageRenderer ? I can`t find any declaration of this object and I still get some errors. Please gimme some good link where I can read about that.
>>> 
>>> best regards,
>>> Dawid Pacholczyk
>>> _______________________________________________
>>> TYPO3-project-typo3v4mvc mailing list
>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>> 
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list