PDA

View Full Version : Ajax.Request ?



TopKatz
29 Mar 2007, 1:34 PM
Hello all!

Before I stumbled on ext, I used prototype for some development. Besides the ever popular $ function the main things I used it for were the ajax handlers. Jack has UpdateManager which is a slick way to do what I used to do with Ajax.Updater. What Im wondering is if there is a plan for a simple request type handler in the works?

I would like to avoid bringing in another framwork for something so small as one function. Prototype is rather large. Yui's connection-min.js is an option at 10k, however if I can avoid using either of them it would be nice.

How do you guys deal with a simple ajax request? If you do not want to hand back a object, maybe just some data, which you would then further manipulate with js before puting it in an existing element.

Thanks in advance.

JeffHowden
29 Mar 2007, 1:44 PM
Check out the Ext.Connection class. It's not yet documented, but it's essentially a mirror of YAHOO.util.Connect. If you'd like to see what makes up the class, you'll find it in /source/data/Connection.js

TopKatz
29 Mar 2007, 1:52 PM
Your the man!

I figured this had to be in the works, or hiding someplace.

Katz

TopKatz
30 Mar 2007, 9:32 AM
Maybe someone with some experience with the data.connection class could help me out abit.

this is not posting anything in firefox:

Ext.data.Connection({
url: "ajaxAdminRequest.php",
scripts:true,
params: parms,
requestcomplete: ajaxGroupWorked()
});

Im sort of a newbie and Im having a hard time figuring out how to use the class jsut by reading the .js. Maybe someone has a simple example that makes a request and handles a call back?

thanks in advance

tryanDLS
30 Mar 2007, 10:33 AM
You need to call the request method. Look at how HttpProxy uses Connection to load data in the grid examples. Here's another way to do it.



var conn = new Ext.data.Connection();
conn.request({
url:mypage.aspx,
params:'action=login',
callback:this.onLoad,
scope:this
});

TopKatz
30 Mar 2007, 10:40 AM
Can I buy you a beer? You totaly rock!