Hi,
As per your reply for loading dhtmlx grid dynamically I have handle “onXLS” event for loading dhtmlx grid. but it gives message
as “Stack overflow at line 5328” i have attached code herewith. Please do comment on it.
is any file missing or wrong with my code.?
function LoadGrid()
{
try
{
mygrid = new dhtmlXGridObject(‘BigGrid’);
mygrid.setImagePath("…/IMAGES/imgs");
mygrid.setHeader(“Index,First Name,Last Name”);
mygrid.setInitWidths(“100,100,100”)
mygrid.setColAlign(“center,center,center”)
mygrid.setColTypes(“ro,ro,ro”);
//mygrid.setOnLoadingStart(function(){ document.getElementById(“a_1”).style.display=“block”; });
//mygrid.setOnLoadingEnd(function(){ document.getElementById(“a_1”).style.display=“none”; });
mygrid.setSkin(“light”);
mygrid.init();
mygrid.enableSmartRendering(true , 327682 , 1000);
mygrid.loadXML("/WorkFlow/servlet/SmartRenderingServlet?Pos_Start="+Pos_Start+"&Total_Count="+TotalCount);
//alert(mygrid.posStart);
//Pos_Start += 1000;
mygrid.attachEvent(“onXLS” ,
function ( x,y)
{
var state = mygrid.getStateOfView();
//alert(state[0]);
mygrid.loadXML("/WorkFlow/servlet/SmartRenderingServlet?Pos_Start="+state[0]);
return false;
}
//the following event not handled by my code
/ mygrid.attachEvent(“onDynXLS” ,
function ( pos,count)
{
var state = mygrid.getStateOfView();
//alert(state[0]);
mygrid.loadXML("/WorkFlow/servlet/SmartRenderingServlet?Pos_Start="+state[0]);
return false;
}
);
/
}//try
catch(e)
{
alert(e);
}//catch(e)
}
//Following are solutions gave by you but not working in my application.
In any moment of time you can call
var state = grid.getStateOfView();
state[0] - current top row
There is an onScroll event, so you can catch the moment when scroll state of grid was changed.
Also, there is onDynXLS event, it occurs when grid request new data from server.
mygrid.attachEvent(“onDynXLS”,function(pos,count){
mygrid.loadXML(any custom server side url here);
return false;
})
If you mean dhtmlxgrid.
grid.attachEvent(“onScroll”,function(x,y){
alert(y);
});
a) in code above you need to use onDynXLS event instead of onXLS ( onXLS event can’t be blocked, and occurs for all loading calls , not only for dyn. data loading )
b) instead of state[0] you can use
mygrid.attachEvent(“onDynXLS” , function (pos,count){
mygrid.loadXML("/WorkFlow/servlet/SmartRenderingServlet?Pos_Start="+pos);
return false;
});