Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tanu Dua on Sep 30, 2009 06:53
open dhtmlx forum
onRowCreated callback in Distributed Parsing

Hi,

We are using DhtmlxGrid with distributed parsing :

<table id="gridbox" name="gridbox" onbeforeinit="gridbox.enableDistributedParsing(true,5,50);"

Also the grid is attached with the callback onRowCreated :

currentgrid.attachEvent("onRowCreated", function(rowId) {
                alert(rowId);
                var noOfRows = currentgrid.getRowsNum();
                
                if(rowId==noOfRows) {
                    setTimeout("showGrid()", 500);
                    enableFundPageLinks();
                }
            });

The question is that I get the alert with rowId only when the no of rows >=7 , that means that onRowCreated callback is not called till row=6 . May I know why is it happening , would change in timeout in enableDistributedParsing would change the behavior of the callback . i.e. can i be sure that the callback would start with rows>=7 when no of rows is 5 in enableDistributedParsing ?

Thanks
Answer posted by dhxSupport on Sep 30, 2009 08:02
Try to attach "onRowCreated" event before grid init:
<table id="gridbox" name="gridbox" onbeforeinit="doBeforeInit()"
...
<script>
function doBeforeInit(){
gridbox.enableDistributedParsing(true,5,50);

gridbox.attachEvent("onRowCreated", function(rowId) { 
alert(rowId);
var noOfRows = currentgrid.getRowsNum();

if(rowId==noOfRows) {
setTimeout("showGrid()", 500);
enableFundPageLinks();
}
});
}
</script>