Solved

Help with YUI FunctionDataSource

Posted on 2008-10-08
1
524 Views
Last Modified: 2012-05-05
Hi Experts,

What would be the best way to grab data from a database with asp and pass it to a YUI FunctionDataSource ...
http://developer.yahoo.com/yui/datasource/#instantiating

I have tried using AJAX to grab the data from the database and i'm returning it in format required, but the problem is that I don't know how to then pass it to YAHOO.util.DataSource

Any help appreciated
0
Comment
Question by:claracruz
1 Comment
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 22675885
You need to look at the "Instantiating a DataSource" section of:
http://developer.yahoo.com/yui/datasource/#start

to see which type of data source applies to you. Since you say you are submitting an ajax request, then if the result is in JSON format then you should be able to use:
var dsLocalJSON = new YAHOO.util.LocalDataSource(xmlHttp.responseText);

Another alternative is that instead of making the ajax request yourself, instantiate the datasource with a direct url to the server where you are sending the ajax request. So, on that example, that is the same as:
// DataSource for a server accessed over XHR  
var dsXHR = new YAHOO.util.XHRDataSource("http://local_path_or_path_to_proxy");  
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now