Solved

Help with YUI FunctionDataSource

Posted on 2008-10-08
1
533 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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

735 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