Rico LiveGrid-JavaScript Buffer
This example demonstrates how to substitute a javascript
call for an AJAX request in the AjaxSQL buffer. Rather than
passing a string containing the url to the data provider,
you pass a function to the Rico.Buffer.AjaxSQL constructor.
buffer=new Rico.Buffer.AjaxSQL(jsfetch);
function jsfetch(options) {
var newRows=[], totrows=500;
var offset=options.parameters.offset;
var limit=Math.min(totrows-offset,options.parameters.page_size)
for (var r=0; r<limit; r++) {
var row=[];
row.push(new Date().toString());
row.push(offset.toString());
for (var c=2; c<5; c++) row.push('cell '+(r+offset)+':'+c);
newRows.push(row);
}
options.onComplete(newRows,false,totrows);
}
Time of Data Fetch
Offset
Column 3
Column 4
Column 5