Node.js and datagrids, how do they work?

1,263 views
Skip to first unread message

Bob Spero

unread,
Mar 31, 2014, 5:49:17 PM3/31/14
to nod...@googlegroups.com
I have a node js project that I can connect to an oracle dB and log the query results to the console. Can any one give me an example on how this information would get to a datagrid? everything I am finding is php based and I am not too familiar with PHP. Anything that would put me on the right track is what I need to look for, thanks! 

Peter Rust

unread,
Apr 1, 2014, 9:44:25 AM4/1/14
to nod...@googlegroups.com
If you're looking for a simple way to get the data from node to a web browser, your best bet would probably be to use a RESTful node.js server, coupled with a client-side data-grid that communicates with a REST server.

There are a lot of REST servers available for node.js and a lot of client-side data-grids (though not all of them can communicate with a REST server out of the box).

Here's what looks like a fully-coded example that uses dojo's dGrid on the client and Express for a REST API on the server: http://www.sw-at.com/blog/2012/05/09/virtual-scrolling-with-dgrid-dojo-dgrid-node-js-and-mongodb/. It uses MongoDB, so you'll need to replace those parts with the code you have to connect to an Oracle DB instead.

Another alternative is Backbone.Datagrid, which uses the client-side Backbone.js framework to communicate with a REST service: http://loicfrering.github.io/backbone.datagrid/. There are a lot of tutorials out there that details how to connect the Backbone client-side framework with various node.js REST servers (Express, Restify, etc).

There are better client-side data grids out there, like jqGrid and SlickGrid, but they might require a bit more work to get talking with a server. If you're just doing the initial load of data and want a read-only grid, it'll be easy to get these working, but for editable data, it might take a bit more work. Here are a couple links on getting jqGrid working with a REST server: http://stackoverflow.com/questions/7344310/using-jqgrids-inline-editing-with-restful-urlshttp://www.javacodegeeks.com/2011/07/jqgrid-rest-ajax-spring-mvc-integration.html

-- peter
Reply all
Reply to author
Forward
0 new messages