Hi all, i am trying to use dhhtmlxGrid with his smart rendering activated. Here’s my js code
function grid()
{
var mygrid = new dhtmlXGridObject('products_grid');
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Product Name,Internal Code,Price");
mygrid.setInitWidths("*,150,150");
mygrid.setColAlign("left,left,right");
mygrid.setSkin("modern");
mygrid.init();
mygrid.enableSmartRendering(true);
mygrid.load("PrendiTutto", "json");
}
In my html i have a tag that launch the application, and “PrendiTutto” is a servlet that is able to read from my database. My problem is that when the mygrid.load(“PrendiTutto”, “json”) is launched there are no parameters passed to my servlet, while i know that the smartRendering uses the “count” and “posStart” parameters. Can anyone help me?
I must explain better my situation… I have a servlet that returns a json, but that servlet gives me an error on loading the parameter “count” and “posStart” from the request… So it returns a json with all my database (11500 rows)… I want my smartRendering to read from the db only the rows visualized in my grid… And the more you scroll the more he read… Dunno if i explained better my situation…
“while servlet gives me an error on loading the parameter “count” and “posStart” from the request”
Please provide the error which you got.
Please note - At first time when your servlet will try to load the values for parameter “count” and “posStart” from the request, they will be null, that is why while creating your json with rows you have to check whether the values are null for parameter “count” and “posStart” or not
If they are null, then you need to specify, that how many records you want to show to the user - the value of which will be assigned to your “count” variable, thereafter both posStart and count values should be used for querying db. If your query is returning all 11500 rows from the db, then I think you are not using posStart and count parameters, in your db query, for restricting the number of records to be retrieved from db.
I think that you might mention in your documentation and samples that for using json is necessary the dhtmlxgrid_json.js. I’ve found it on another forum and now all is running well.
Hi, pls update your docs with the information on including ext/…json.js as it is really hard to find out, that it is needed for functions like pagination and smart rendering Thanks!