PDA

View Full Version : Prototype's Ajax.Request ... Ext abstraction?


Saeven
05-11-2007, 03:31 PM
Hi guys,

Right now we have a project that's laden with prototype style Ajax.Request calls:

standard post:

new Ajax.Request( 'index.php', {
method: 'post',
parameters: { tsrc: 'navtable', tplfetch: 1, secondary: 1 },

onSuccess: function(transport) {
Ext.get( 'navtable' ).update( transport.responseText );
}
});


json data:

new Ajax.Request( 'index.php', {
method: 'post',
parameters: { tsrc: 'kb', category: cat, act: article },
requestHeaders: {Accept: 'application/json'},
onSuccess: function(kbt) {
var json = kbt.responseText.evalJSON();
$( 'kbviewport' ).innerHTML = json.article;
$( 'comment-cn' ).innerHTML = json.commentForm;
}
});


What's the direct Ext replacement for the above in both json, and standard response returns? Thanks again for your help. I know this is an RTFM type question!

Cheers.
Alex