View Full Version : Load XML data from field into Ext.data.store?

22 May 2009, 10:50 AM
No doubt this is a simple question and I'm just over tired, but how do I load XML stored in a textarea field on the page into an Ext.data.Store?
Works fine with the URL parameter, but I want to be able to make edits and then load a data grid.

22 May 2009, 3:45 PM
Well, may not be the best method but the following works to generate an object "xmlDoc" which can then be passed to the Ext.data.Store as its Data property.

myData = String(document.getElementById('myXML').value);
if (window.ActiveXObject) {
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
} else {
var xmlDoc = new DOMParser().parseFromString(myData,"text/xml");