[TYPO3-mvc] Using ajax in extbase

Dennis Ahrens dennis.ahrens at googlemail.com
Tue Jul 6 13:32:32 CEST 2010


Hi Eat,

in JavaScript you need a URL that matches the GET/POST syntax used by 
extbase and fluid, to set up the ajax request. MvcExtjs includes a 
JavaScript UriBuilder that works for the backend.

http://forge.typo3.org/projects/extension-mvc_extjs/repository/entry/branches/view/Resources/Public/JavaScript/ux.TYPO3.MvcExtjs.UriBuilder.js

This version is not tested yet - i've backported it from my project @ 
work into mvc_extjs, but i haven't used it by now.

If you have included the js-file you have to initialize the UriBuilder 
first by calling:

Ext.ux.TYPO3.MvcExtjs.UriBuilder.initialize('YourExtensionName','YourModuleKey');

After that you can create URL's with:

url = 
Ext.ux.TYPO3.MvcExtjs.UriBuilder.uriFor('action','controller',{'paramName':'paramValue'},'json');

Call extbase (by using extjs) like this:

Ext.Ajax.request({
    url: myAjaxUrl,
    success: function(success, options) {
		// handle response
    },
});

regards
Dennis


More information about the TYPO3-project-typo3v4mvc mailing list