Has anyone used an AJAX data grid with Rails? I am rebuilding a copy of the venture source web site as a first ruby/ rails exercise. If anyone has used a javascript data grid with Rails, I would appreciate sample code, or notes on your experience. The controller action would presumably communicate with the data grid component running on the browser by extracting data from a relational DBMS into a model, and then serializing that into XML or JSON which the Javascript component could import. However, if there was a way of bypassing the generation of an intermediate XML | JSON representation, by injecting data into a rails-compatible server-side component that sent the entire grid component (preloaded with data from the rails model) as javascript to the client, that might be simpler.
jSON vs Component: It depends on what you want to do with the generated grid. If you need to munge the data to put it into a grid (i.e. dates, timespan) for display purposes, it is sometimes handy to have the raw json object around so that you dont have to do a whole lot of un-munging in JS to get at the data. It also depends on where alot of your UI logic is. rails traditionally has alot of contoller logic on the server side. I have gone down the route of having a more structured JS application, where I need to massage the data more, the server being fairly dumb (i.e. outputting json from DB mostly). On 6/14/06, Thomas Atwood <thomas.atwood-ee4meeAH724@public.gmane.org> wrote:> Has anyone used an AJAX data grid with Rails? > I am rebuilding a copy of the venture source web site as a first ruby/ > rails exercise. If anyone has used a javascript data grid with > Rails, I would appreciate sample code, or notes on your experience. > The controller action would presumably communicate with the data grid > component running on the browser by extracting data from a relational > DBMS into a model, and then serializing that into XML or JSON which > the Javascript component could import. However, if there was a way > of bypassing the generation of an intermediate XML | JSON > representation, by injecting data into a rails-compatible server-side > component that sent the entire grid component (preloaded with data > from the rails model) as javascript to the client, that might be > simpler. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Hey Thomas, I''ve been working on a grid for awhile with the hope of creating a Rails component of it - I really want to try to use the clientside xslt approach for it, which I think could be done with XML, JSON, or whatever with the rowdata. Some other info about the columns would still need to come from somewhere. Right now, I''m extrapolating that information from a skeleton of xhtml before the first xslt transformation. Are you interested in developing this, or were you just mostly wondering if something already existed? Here''s a test page for the clientside xslt (Sarissa is fast): http://development.finetooth.com/?p=15 Here''s the grid "working" better- http://development.finetooth.com/?p=6 -l Thomas Atwood in message [Rails-spinoffs] AJAX data grid for Rails? (Tue, 06/13 11:31):> Has anyone used an AJAX data grid with Rails? > I am rebuilding a copy of the venture source web site as a first ruby/ > rails exercise. If anyone has used a javascript data grid with > Rails, I would appreciate sample code, or notes on your experience. > The controller action would presumably communicate with the data grid > component running on the browser by extracting data from a relational > DBMS into a model, and then serializing that into XML or JSON which > the Javascript component could import. However, if there was a way > of bypassing the generation of an intermediate XML | JSON > representation, by injecting data into a rails-compatible server-side > component that sent the entire grid component (preloaded with data > from the rails model) as javascript to the client, that might be > simpler. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Lindsey Simon lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 Public Key: http://www.commoner.com/pubkey.asc
I apologize for being so behind on my reply to this, but I wrote an article earlier this year on just this: http://unspace.ca/discover/datagrid Hopefully you find it useful. Pete ----- Original Message ----- From: "Thomas Atwood" <thomas.atwood-ee4meeAH724@public.gmane.org> To: <rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> Sent: Tuesday, June 13, 2006 2:31 PM Subject: [Rails-spinoffs] AJAX data grid for Rails?> Has anyone used an AJAX data grid with Rails? > I am rebuilding a copy of the venture source web site as a first ruby/ > rails exercise. If anyone has used a javascript data grid with Rails, I > would appreciate sample code, or notes on your experience. The > controller action would presumably communicate with the data grid > component running on the browser by extracting data from a relational > DBMS into a model, and then serializing that into XML or JSON which the > Javascript component could import. However, if there was a way of > bypassing the generation of an intermediate XML | JSON representation, by > injecting data into a rails-compatible server-side component that sent > the entire grid component (preloaded with data from the rails model) as > javascript to the client, that might be simpler. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >
Maybe Matching Threads
- Updatable "datagrid" with ajax support? Is there any code/approach I can leverage?
- Re-orderable column DataGrid + Patches for Sortable.delay and Sortable.ignorePositionXY
- How do booleans work?
- DataGrid (Table) using tables/Scriptaculous Sortable
- no network in domain 0