PDA

View Full Version : database updates with ajax



bagus
3 May 2007, 8:27 AM
Hey,

Why isn't there much documentation out there on how to do database updates with ajax?

Is this something the extjs folks think is out of their scope? Is this part of extjs 2.0? 3.0?

Is it already there and I can't find it?

Are you folks looking for someone to pave the way there still?

I'm a little surprised that while extjs has a nifty editable grid, there's nothing about how to get that changed data back to the database.

Thoughts?

Thanks,

Bagus

tryanDLS
3 May 2007, 9:26 AM
There are number of threads discussing options for this - you'll have to do some searches. Updating the DB is a server process which Ext knows nothing about. You have to implement something to talk to your server and pass updates in a format that your back-end understands.

jsakalos
3 May 2007, 10:20 AM
The rough framework I'm successfuly using is:

1. Prepare options. It's something like:


var options = {
url: '/ajax.php'
, method:'post'
, params: { ... server dependent + all data ... }
, callback: function(options, bSuccess, response) {
... ext app dependent ...
}
};
2. Send server request:


new Ext.data.Connection().request(options);
I want to tell you that this is not the only option. I use this sequence when I need to send data that is not part of any form, e.g. as result of user's drag & drop.

There are other methods how to send data, e.g. from forms.