PDA

View Full Version : the xml file


techno_adi
09-14-2006, 05:50 AM
hi,
can we have the xml file which was used on yui ext grid control part-2
i suppose its sheldon.xml

thanks

jack.slocum
09-14-2006, 06:51 AM
Sure,

http://www.jackslocum.com/blog/examples/sheldon.xml

techno_adi
09-14-2006, 07:18 AM
Thanks a lot
just out of curiosity..
did you just make it accessible? coz.. i tried the same link earlier i was not able to get the file.. :!:
Sure,

http://www.jackslocum.com/blog/examples/sheldon.xml

jack.slocum
09-14-2006, 07:42 AM
Nope. That's the same one the blog post uses. Was the post down too?

techno_adi
09-14-2006, 08:12 AM
Nope..
i got the reason..
the link i was trying to access was
jackslocum.com/yui/blog.... which was giving problems..
thanks a lot..
an AWESOME extension
hope you give more examples on grid in coming days..
may be an example using a database (say sql server) to populate the data grid..:idea:
hope to have more of this from you soon

Nope. That's the same one the blog post uses. Was the post down too?

jbowman
10-09-2006, 12:02 AM
Nope..
i got the reason..
the link i was trying to access was
jackslocum.com/yui/blog.... which was giving problems..
thanks a lot..
an AWESOME extension
hope you give more examples on grid in coming days..
may be an example using a database (say sql server) to populate the data grid..:idea:
hope to have more of this from you soon

Nope. That's the same one the blog post uses. Was the post down too?

That'd be handled by the backend script you're calling to generate the xml. Bascially you'd write a script in whatever language you're using to do the sql, and have it output the xml.

techno_adi
10-09-2006, 02:06 AM
That'd be handled by the backend script you're calling to generate the xml. Bascially you'd write a script in whatever language you're using to do the sql, and have it output the xml.

Actually, I am new to web development. Infact to be honest YUI( and Ext) has been my first step towards web-development. I find most of the things explained here [by jackscloc and others - thanks to all] very informative and most importantly simple to understand for novices like me.

The problem is mainly faced when there is no prior [quick-start] examples available for the specific topics [ like the one i had asked here earlier].

But, again thanks to the forum : "The answers are available in no time :) "

xbartv
10-14-2006, 02:01 AM
Hi, i downloaded the "amazon.php" file from http://www.jackslocum.com/blog/examples/amazon.php and i used it to run the example of "A Grid Component for Yahoo! UI - Part 2" in my local server but the amazon.php doesn't retrieve me any data and i received an error in the page when i do the search by authors. What could be wrong ??

Another thing i don't understand is that i get the new data from this line
this.dataModel.load('amazon.php', params, this.clearIndicator);
so, i call a script in php but when i saw this file it is a xml file with a php extension. If the script was real php, what i have to do ? Generate a xml file or post the result in an array ?

Sorry, but i'm very confuss on how to retrieve the new data on the grid.

jack.slocum
10-14-2006, 03:07 AM
Here's the source for amazon.php. It's pretty simple.

http://www.jackslocum.com/blog/examples/amazon.phps

rtoepfer
10-24-2006, 11:46 PM
I'm having trouble reading in XML data created from a php file as well.

Part of my javascript code:

var schema = {
tagName: 'row',
id: 'use-index',
fields: ['name', 'sunday', 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','total']
};

dataModel = new YAHOO.ext.grid.XMLDataModel(schema);

dataModel.load('/webapp/payroll.php');

And payroll.php server file:

<?php

$string = <<<XML
<payroll>
<row>
<name>Randall Toepfer (reg.)</name>
<sunday>8.00</sunday>
<monday>7.00</monday>
<tuesday>8.00</tuesday>
<wednesday>5.00</wednesday>
<thursday>8.00</thursday>
<friday>8.00</friday>
<saturday>4.00</saturday>
<total>48</total>
</row>
<row>
<name>Randall Toepfer (over.)</name>
<sunday>8.00</sunday>
<monday>7.00</monday>
<tuesday>8.00</tuesday>
<wednesday>5.00</wednesday>
<thursday>8.00</thursday>
<friday>8.00</friday>
<saturday>4.00</saturday>
<total>48</total>
</row>
<row>
<name>Randall Toepfer (vac.)</name>
<sunday>8.00</sunday>
<monday>7.00</monday>
<tuesday>8.00</tuesday>
<wednesday>5.00</wednesday>
<thursday>8.00</thursday>
<friday>8.00</friday>
<saturday>4.00</saturday>
<total>48</total>
</row>
</payroll>
XML;

$xml = new SimpleXMLElement($string);

echo $xml->asXML();

?>

I checked that the php script outputs XML via my browser. If the same XML outputted by the php script is placed in a file with an xml extension, say payroll.xml, then the grid will load. Of course the construction is changed to dataModel.loadData('/webapp/payroll.xml);

The error I get is "doc has no properties yui-ext_32_2.js (line 329)"

Anyone have any thoughts on why this won't work? Thanks in advance.

rtoepfer
10-24-2006, 11:47 PM
I tried using both functions load and loadData, which is the reason for the ambiguity on the post.

jack.slocum
10-25-2006, 11:22 AM
Your script has to send XML headers for XHR to parse it. It doesn't recognize it automatically (who knows why).

header('Content-Type: text/xml');

rtoepfer
10-25-2006, 12:22 PM
Fixed my problem. Thanks for the help.