[TYPO3-mvc] TYPO3 6.x way for extbase ajax applications

Robert Böttner robert at boettner.it
Tue Apr 16 11:53:03 CEST 2013


Hi Joerg,

depending what you are doing with the response you´ll have to return it in that way. If you are using the method to load data into an ExtJS store your response has to be a json object structured like the your stores underlying model. If you are using HTML as a return a simple panel.update() with your response text should do.

I´m using the eID approach and a store configuration may look like:

Ext.define('AbutmentOrder.store.Orders', {
    extend: 'Ext.data.Store',
    requires: 'AbutmentOrder.model.Order',
    model: 'AbutmentOrder.model.Order',

	remoteSort: true,
 	pageSize: 20,
	proxy: {
		 type: 'ajax',
		 url: 'index.php',
		 pageParam: 'tx_bitmedenticad_display[page]',
		 startParam: 'tx_bitmedenticad_display[offset]',
		 limitParam: 'tx_bitmedenticad_display[limit]',
		 sortParam: 'tx_bitmedenticad_display[ordering]',
		 directionParam: 'tx_bitmedenticad_display[direction]',
		 simpleSortMode: true,
		 extraParams: {
			 eID:'ajaxDispatcher',
			 extensionName: 'bitmedenticad',
			 pluginName: 'Orders',
			 controllerName: 'Ordering',
			 actionName: 'list'
		 },
		 reader: {
			 type:'json',
			 root:'data'
		 }
	}
});

If it´s HTML a controller method would be sth like this:

showHelp: function(page) {
		var helpWindow = new AbutmentOrder.view.HelpWindow();

		Ext.Ajax.request({
			url: 'index.php',
			params: {
				id: userhelp.upload,
				type: 1363795020
			},
			scope: this,
			success: function(response){
				var text = response.responseText;

				helpWindow.down('panel').update(text);
				helpWindow.show();
			},
			failure: function (response) {
			}
		});
	},

Best
Robert.


Am 16.04.2013 um 11:17 schrieb Joerg Schoppet <joerg at schoppet.de>:

> Hi list,
> 
> I'm in the process of creating a new extension, which should be up-to-date regarding the coding-standards of TYPO3 6.x and extbase. Additionally I want to create a complete ExtJS application in the frontend.
> 
> I found some (not so much) information in the web (including the blog of Daniel Lienert and also the pt_extbase extension).
> 
> I tried the typeNum-way and also the eID-way, but still I have one unresolveable problem.
> 
> With the extbase_kickstarter I created an extension, which holds a class which extends the fe_users class from Extbase. Currently this class doesn't has any additional fields.
> 
> If I create new frontend-users with this "type" I can have the list-action in the frontend output all the users.
> 
> BUT
> 
> If I try to get these users with an ajax-request (typeNum- or eID-way) I get no result.
> 
> Can anybody point me in the right direction what the problem is?
> 
> 
> Thanks a lot.
> 
> Joerg
> _______________________________________________
> 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