PDA

View Full Version : Local YAHOO.ext.grid.LoadableDataModel.load()



manxomfoe
18 Oct 2006, 3:56 PM
I'm trying to get a local prototype working of the example provided here:
http://www.jackslocum.com/yui/2006/08/31/a-grid-component-for-yahoo-ui-part-2/

The basic grid works fine, but when I try to do a local preview of the simple html file, I don't get any data. Some simple debugging has revealed that this method isn't actually loading any data.


this.dataModel.load('/blog/examples/sheldon.xml');

I've tried using a fully qualified URL to the file on the blog, and a local copy of the file as well. It seems that the example doesn't actually parse it from this local statement, but relies on this code to populate the grid when it finishes parsing itself empty.


YAHOO.util.Event.onAvailable('example-form', function(){
getEl('example-form').mon('submit', XmlExample.search,
XmlExample, true);
});

This code manually submits the search function and re-loads data using this line. It's one that I can't replicate locally (no php), so I can't figure out exactly what I'm tripping over.


this.dataModel.load('/blog/examples/amazon.php', params, this.clearIndicator);

There's a tickle in my head that some AJAX libraries don't handle loading content from local sources, kind of like loading from other domains. Is this one of those libs? Any help is greatly appreciated!

-brian

jack.slocum
18 Oct 2006, 4:19 PM
You can't load from local files, XMLHttpRequest doesn't support it. I'm sure it's for security reasons.