[TYPO3-mvc] Extbase Backend Ajax Call
Andrea Schmuttermair
abo at schmutt.de
Tue Jan 21 14:45:53 CET 2014
Hello,
how can I create a ajax call in TYPO3 Backend using Extbase?
In Frontend, I usually configure typeNum for Ajax rendering, but I
have no idea how to do that in a Backend Module.
With this code, I get a successful Ajax return, but its content is a
complete HTML Page returned with <head> and everything.
Important: needs to be running on TYPO3 Version 4.5
Controller:
class Tx_Test_Controller_TestController extends
Tx_Extbase_MVC_Controller_ActionController {
public function testAjaxAction() {
$test = array('test'=>1, 'test2'=>2);
return json_encode($test);
}
}
Fluid:
<script type="text/javascript">
Ext.Ajax.request({
url: '<f:uri.action action="testAjax" />',
timeout: 60000,
method: 'GET',
scope: this,
params: '',
success: function(resp) {
console.log(resp);
},
});
Thanks for any advice!
Andrea
More information about the TYPO3-project-typo3v4mvc
mailing list