Web dev and programming discussions forums
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Re: Need a little guidance on which widgets to use

Plotting multiple datasets with DataChart
(19 lines)
Re: How to open menu for Filtering Select
(9 lines)
Mar 10, 2010
Peter Svensson
Peter Svensson
What you need to do to get data out of a store, is use the fetch function.
Examples can be found here;
http://docs.dojocampus.org/dojo/data/api/Read

<http://docs.dojocampus.org/dojo/data/api/Read>Since you create a
store
first which you then use when creating the grid, the grid knows how to get
data out of the store.
To take out data from the store 'manually', you do like this;


var store = new some.Datastore();var gotItems = function(items, request){
  console.log("Number of items located: " +
items.length);};store.fetch({onComplete: gotItems});


This will call the gotItems function once for each item in the store. If
you
want to filter out one or several specific items, you can add a query
paramter, so that the call look like;

store.fetch({query: {name: "a*"}, onComplete: gotItems});

Should fetch all items where the property 'name' begins with an 'a'.

Cheers,
PS

On Wed, Mar 10, 2010 at 6:35 AM, onederlnd <oned### @gmail.com>
wrote:


 I'll right off the bat admit that I'm new to Dojo and even
AJAX/Javascript
 coding so please excuse me if this may seem simple to some.

 I am looking for a little guidance on where to look for what I'm
trying to
 accomplish with my Grid.

 1: Currently I use an XML database which has all my clients
information.  I
 am looking to do a mathematical equation to figure out their age
based on
 the birthdate in the XML file minus the current month/year and then
that
 information is imputed into an Age column within the grid (this would
be
 done without writing the actual age into the XML file.  At the moment
I'm
 using dojox.grid.DataGrid and dojox.data.XmlStore as well if that
makes a
 difference.

 2: The second problem I'm having is displaying database information
in a
 different spot other than in grid, such as clicking on a grid row and
the
 info showing up in a separate ContentPane.  I have seen it done but
can't
 figure out how to get it working.

 I do appreciate anyone taking the time out to help me and apologized
for my
 stupidity when it comes to Dojo and the workings of it.
 --
 View this message in context:

http://n3.nabble.com/Need-a-little-gu...39093p439093.html
 Sent from the Dojo Toolkit mailing list archive at Nabble.com.
 
Reply
Tags: grid, store, items
Messages in this thread
Re: Need a little guidance on which widgets to use