Problem with smart rendering

I am trying to use the Grid to display some records in smart rendering mode.

But I can only see the first load. If I scroll down and try to load more data, the new data can be requested and received, but can not be displayed in the grid window. If I scroll back to the top, sometimes, the original data disappear too.



I am wondering if I missed anything. Your help is really appreciated.



I am using version 2.0. and my javascript looks like:

var mygrid;



function doInitGrid(){

mygrid = new dhtmlXGridObject(‘mygrid_container’);



mygrid.setImagePath("/dhtmlxGrid/codebase/imgs/");





mygrid.setSkin(“light”);

mygrid.init();

mygrid.enableSmartRendering(true, 50);

mygrid.xmlFileUrl = “dataload.jsp”;

mygrid.loadXML(“dataload.jsp”);





}

the xml looks like:





Tsnid

ScientificName





CommonName

ParentTsnid

Source

RankName

AuthorName

ItisStatus

Expert

ExpertDate

Action

Approved





ApprovalDate

Status

Rowindex







15741^javascript:queryNewTaxonInfo(15741)

;^_self

Sphagnum girgensohnii

Girgensohn’s moss

15683

ITIS

Species

Russ.

accepted

system

2009-01-20 11:11:53.0

created





New

51







15742^javascript:queryNewTaxonInfo(15742);^_self

Sphagnum fimbriatum

fringed bog moss

15683

ITIS

Species

Wils. in Wils. & Hook. f. in Hook. f.

accepted

system

2009-01-20 11:11:53.0

created





New

52





Please check if you have been included “dhtmlxgrid_srnd.js”. If issue still occurs please provide to the support@dthmlx.com sample with this issue.


Thanks for your quick response.



I did include dhtmlxgrid_srnd.js. If not, I will receive a javascript error says “enablesmartrender” is not defined.



 

the new data can be requested and received, but can not be displayed in the grid window
a) Check the response generated by server side, it must contain valid pos@rows value , the grid will use value of pos attribute as start point for row insertion , so if it points to incorrect place - rows will be inserted incorrectly.

b) Please be sure that section of XML loaded only for initial data request, if it will be included in response for additional data request - it will cause full grid reconfiguration , which is unnecessary in your case.

c) If you are using custom skin or some external styles affect height of grid’s row, position in grid can be calculated incorrectly. ( can be fixed by direct usage of grid.setAwaitedRowHeight )

Excellent!
b) is the solution. I did include section in all xml returns.

Thank you very much. Great technical support.