Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

Help with YUI FunctionDataSource

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
claracruz
Asked:
claracruz
1 Solution
 
hieloCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now