rmorrissey
29 May 2007, 7:51 AM
Hey Guys,
I'm about to implement an EditableGrid for a project I'm working on. I have most of the code working now, and am about to send the results of edited cells to the server for integration with the existing DB backend.
I'm wondering whether anyone has any best practices for submitting large amounts of XMl via post?
At the moment I am using the following code to save/send:
eds = ds.getModifiedRecords();
for(var i = 0; i < eds.length; i++) {
var editXML = eds[i].store.reader.xmlData;
}
var cb = {success: function(o) { alert('success'); }, failure: function(o) { alert('failure'); } }
Ext.lib.Ajax.request('POST', '/ajaxhandler.php?command=setdata', cb, editXML);
ds.commitChanges();
Which gives me the following results from my (debug) PHP script:
Array
(
[<?xml_version] => "1.0" encoding="ISO-8859-1"?>
<plan>
<element>
<id>3629</id>
...
(the rest cut for space)
As you can see, it gets quite messy.
Before I go about doing some custom escaping - does anyone else have a 'best practice' solutions for this? Or have I missed something obvious you do in this situation?
I'm about to implement an EditableGrid for a project I'm working on. I have most of the code working now, and am about to send the results of edited cells to the server for integration with the existing DB backend.
I'm wondering whether anyone has any best practices for submitting large amounts of XMl via post?
At the moment I am using the following code to save/send:
eds = ds.getModifiedRecords();
for(var i = 0; i < eds.length; i++) {
var editXML = eds[i].store.reader.xmlData;
}
var cb = {success: function(o) { alert('success'); }, failure: function(o) { alert('failure'); } }
Ext.lib.Ajax.request('POST', '/ajaxhandler.php?command=setdata', cb, editXML);
ds.commitChanges();
Which gives me the following results from my (debug) PHP script:
Array
(
[<?xml_version] => "1.0" encoding="ISO-8859-1"?>
<plan>
<element>
<id>3629</id>
...
(the rest cut for space)
As you can see, it gets quite messy.
Before I go about doing some custom escaping - does anyone else have a 'best practice' solutions for this? Or have I missed something obvious you do in this situation?