Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Help with YUI FunctionDataSource

Posted on 2008-10-08
1
532 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
how can i get 4 nd 5 ? 3 31
suddenly angular cli doesn't work. 5 40
jquery tab header text 1 23
Do alert on select 6 14
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

828 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