-
16 Nov 2006 1:24 PM #1
Trouble getting started with Grid and XML
Trouble getting started with Grid and XML
I'm trying to implement a grid to display XML data, using the http://www.jackslocum.com/yui/2006/0...hoo-ui-part-2/ example as a starting point.
I've created a simple page with the code, here:
http://richgay.com/test/gridtest.html
The page loads and the grid header displays, but no rows, and an error in Firefox 2.0/Mac:
With Safari, the header and first row displays, and there is no error displayed in the Javascript console.Code:Error: junk after document element Source File: http://richgay.com/test/serverconfigdata.xml Line: 8, Column: 1 Source Code: <item>^
No doubt I've made a fundamental mistake... thanks in advance for any help.
-
16 Nov 2006 3:16 PM #2
Is the xml valid? Maybe just a stray quote? If you open the xml file in IE, does it choke?
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
16 Nov 2006 4:07 PM #3
You were on the right track. The XML for the items needed to be wrapped. It's working now.
Originally Posted by tryanDLS
-
17 Nov 2006 11:17 AM #4
I'm trying to modify my grid to load the XML data from a hidden div in the page, rather than issue a separate page request.
Previously, to load the xml from a document, I used:
I've changed to this:Code:this.dataModel.load('serverconfigdata.xml');
I'm getting this error in the yui-ext library:Code:var myXMLdiv = document.getElementById ("xmlcontent"); var myXMLcontent = myXMLdiv.innerHTML; this.dataModel.loadData (myXMLcontent);
I'm certain I'm doing something incorrectly here...Code:Error: doc.getElementsByTagName is not a function Source File: http://richgay.com/test/scripts/yui-...rc1/yui-ext.js Line: 482
Page with the code is here:
http://richgay.com/test/gridtest.html
-
17 Nov 2006 11:34 AM #5
Off the top of my head, try
Code:this.dataModel.loadData (myXMLcontent.documentElement);
-
17 Nov 2006 11:43 AM #6
No success, but a different error reported:
Originally Posted by Animal
Code:Error: doc has no properties Source File: http://richgay.com/test/scripts/yui-...rc1/yui-ext.js Line: 482
-
17 Nov 2006 11:46 AM #7
Stop in the Connection object and take a look at the XmlHttpRequest's properties.
It's a very fussy XML parser, and it gives you a null document if anything's wrong.
-
17 Nov 2006 11:49 AM #8
Oh, I just saw that you're passing in HTML from a div. Are you sure that the browser is preserving the XML that you put there?
I think the only way to preserve XML text in an HTML document is to send it out inside a textbox. Then you can get the value of that.
-
17 Nov 2006 12:03 PM #9
It appears to be correct. If I view the source of the page, it appears intact.
Originally Posted by Animal
I'll give that a try... after lunch.
Originally Posted by Animal
Thanks for the suggestions!
-
17 Nov 2006 2:28 PM #10
I've modified the included XML to be wrapped with an <xml> tag, and verified the content is included and correct. Still getting this error:
Code:Error: doc.getElementsByTagName is not a function Source File: http://richgay.com/test/scripts/yui-...rc1/yui-ext.js Line: 482
Similar Threads
-
trouble passing grid info via seletionchange
By pjordan in forum Ext 1.x: Help & DiscussionReplies: 9Last Post: 16 Mar 2007, 4:33 AM -
Trouble adding rows to grid manually.
By kjordan in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 9 Mar 2007, 3:22 PM -
Grid layout trouble
By Belgabor in forum Ext 2.x: Help & DiscussionReplies: 8Last Post: 25 Feb 2007, 3:21 PM -
trouble using Grid and LayoutDialog with a grid?
By franklt69 in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 3 Feb 2007, 4:25 PM -
Grid: Getting Started !
By allaboutyui in forum Community DiscussionReplies: 0Last Post: 16 Nov 2006, 9:04 AM


Reply With Quote