« LiveGrid beta 2 scrolling design | Main | Learning Languages »

August 30, 2005



First, thanks for a great tool, liveGrid is very cool. But I am having a devil of a time trying to recreate your demo. :-(. The first problem I ran into was in your RicoLiveGrid.pdf - the example for the XML returned (on page 5) uses an id of "grid_data_updater" whereas the corresponding HTML (on page 3) uses an id of "data_grid" (the words data and grid are reversed). That took me forever to track down. Now that I have that fixed, I am able to populate a grid and scroll through it but I can't sort and it works only if my server script sends an entire table of data (I am assuming it should only send 10 or 11 rows at a time). My server script is sending the correct chunk (e.g records 48-58 sorted by the column I clicked on in the grid) but the liveGrid buffer never seems to see that. How can I debug?

Richard Cowin

Thanks for the correction in the document. Sorry for the confusion.

You defintely should not have to send the whole table. The number of records in the request really depends on the number of visible rows in the table.

If you don't do sorting, does the scrolling work without having to load the whole content?

I think the row number in the first td of the request is important.

I have updated the post to show the rhtml for the ajax response.


If I send only the number of rows in the viewport, It only shows me records 1-10 (even though I know the XML is different rows) and if I scroll I get e.g. rows 8,9,10,1,2,3,4,5,6,7.

Rownum in the XML? I don't see that in the examples. Do you mean a rownum attribute on the first td in each row, or do you mean a first td in each row which is the rownum? Neither seems to work on first try.

Richard Cowin

Well, I looked at the code base and we actually don't use the TD. I think we were using it for mainly debugging support. Sorry for the distraction.

One thing you might try is to use Firefox and the greasemonkey
extension with the XmlHttpRequestDebugging user script. This
is a very handy AJAX debugging tool.

If that does not work, what is your ajax handler on the server written in? If you send me a copy, I could check for anything obvious.


Thanks for the replies. I'll try greasmonkey. I'm using Perl (working on a frontend for DBI - Perl's database interface). I'll email you sometime next week if I can't get things working or post here if I can.


Aha! At last! Solved! My problem was in assuming that the parameters passed by clicking on the scrollbar were the same as the parameters passed by clicking on the bookmark link - in other words my Ajax handler was expecting "data_grid_sort_col", and "data_grid_index" and was really getting "sort_col" and "offset". As soon as I found that out (by sticking an alert in prototype.js to show what parameters were being passed) and changed the handler, presto, everything works - I'm getting the correct chunks of data, can scroll through the entire data set, and get things sorted in the proper order when I've specified a sort column. W00t! Thanks for your help.


This grid is just what the doctor ordered, but I'm in dense mode right now. Any chance you can post a simple asp.net example?

Richard Cowin

I am not an asp.net programmer and would probably not do it justice. I am pretty sure there are some asp.net programmers posting to the rico forum. You might try at: https://rico.tigris.org/servlets/ProjectForumView

I would like to post some examples (or at least references to examples) using different development platforms on the openrico.org site. If anyone has examples using the LiveGrid in your favorite platform, shoot me an email with a reference or the code and I will try to post them.


I really commend you guys on this livegrid component, but the document should be be correct if it's to be published, i just spent hours and hours debugging and going out of my mind trying to figure out why I couldn't get the grid updating correctly, only to find the typo in the document and subseqeuntly my code after reading this comments section. I'm willing to write a tutorials for dummies guide to get it working, if it will get published. But *please* spend 5 mins correcting it so the next poor sod doesn't go through the same right of passage. Page 1,2,3,4 refers to "data_grid" On Page 5, XML code, change "grid_data..." to "data_grid".

Richard Cowin

Point well taken.
I got my hands on the original source for the tutorial. It is now updated and on the openrico.org web site. I also updated the example to show the extra div needed in beta 2.

Sorry for the pain.

Any help with future examples, tutorials, and other documentation is appreciated. I will update the openrico.org site to include references. I am working on refreshing the web site. Should be soon.


Cool - I'll setup a worked example up for PHP'ers on the weekend. Will update this blog when I've done it.. Now getting everything working and it's VERY cool.

Jim Nickel


Just finished getting the sort functionaility in 1.1 (beta 2) working from PHP. A couple problems.

1) The "ignore" field is not used - this is different than you describe.
2) The rico.js was broken - I had to add this line: return columns; to the convertToTableColumns function in order to get it to work.

Just thought you guys should know. Thanks for all your work on this!

When I am done, I would be happy to supply some examples using PHP as the backend.


Zanfar Ali

Thanks for the sort fix Jim. I was having real trouble trying to work out why it was broke. Am using the grid with asp and it works great.


could you please send the whole source code for livegrid(ruby on rails) to me?
thanks alot

Rakesh Malik

Has anyone else run into this? Do you have any suggestions on fixing it?

Error: {largeBufferSize:7, nearLimitFactor:0.2}.extend is not a function
Source File: https://localhost:3000/javascripts/rico.js
Line: 1755

Mark Tsikanovski

Hi all,
A further fix for column sort to go with Rowan's. If you have multipart collumn names eg: "Internal Part Number", and you use the collumn parms, you need to include the same name conversion in convertToTableColumns function as you have in deriveColumnNameFromCell function, so it looks like:

convertToTableColumns: function(cols) {
var columns = new Array();
for ( var i = 0 ; i < cols.length ; i++ ) {
cols[i][0] = cols[i][0].toLowerCase().split(' ').join('_') + '_'; //For multipart collumn header names
columns.push( new Rico.TableColumn( cols[i][0], cols[i][1] ) );
return columns;



I ran into Jeff's problem exactly. I was expecting "data_grid_sort_col", and "data_grid_index" not "sort_col", "offset", and "sort_dir".

I'm using PERL/CGI to deliver the xml and thanks to Jeff it only took me a couple of hours to get sorting working.

Kunaal Malhotra


Thanks for a great tool. Do you know of any URLs/examples of using Rico with ASP.NET? The URL given above (https://rico.tigris.org/servlets/ProjectForumView) is not working.


Josh Martin

Well looks like this along with just about every other implementation is succeptable to SQL injection.

If you need something that actually checks the data before generating queries, try: https://pastie.caboo.se/16283

The comments to this entry are closed.