Grid Serialization Performance Issue

Hi,
Grid Serialization Performance Issue:-
I have grid loaded with more than 3000 records. Each row have checkbox controls. I checked minimum 100 record and click on ‘submit’ button.

Oncheck control:-
mygrid.attachEvent(“onCheck”, function (rId, cInd, state) {
var colNum = mygrid.getColumnCount();
for (i = 0; i < colNum; i++) {
colLabel = mygrid.getColLabel(i);
if (colLabel == “”) {
var selectColNum = i;
}
}
var count = mygrid.getCheckedRows(selectColNum);
if (count != “”) {
if (count.split(’,’).length == mygrid.getRowsNum()) {
$("#gridbox input:checkbox").attr(‘checked’, ‘checked’);
}
else {
$("#gridbox input:checkbox").removeAttr(‘checked’);
}
}
else {
if (count == “” && mygrid.getRowsNum() == 1) {
$("#gridbox input:checkbox").removeAttr(‘checked’);
}
}
});
}
Click On Submit Button:

function GridToXml() {
//count how many colums were submited from GRID
var colNum = mygrid.getColumnCount();
//check which colum was selected
for (i = 0; i < colNum; i++) {
colLabel = mygrid.getColLabel(i); //Header Name Loaded ,More than 135 Names
// Delete header label is = “”
if (colLabel == “”) {
var selectColNum = i;
var myXmlStr = mygrid.serialize();
alert(‘myXmlStr’+myXmlStr);
}
}

var values =
        {
            "ID": selectColNum,
            "Xml": escape(myXmlStr)
        }
        alert('values'+values);
return values;

}

My Issue is after i passing the ‘values’ i got xml format error.
But minimum record is possible to passing the values.

Unfortunately the issue cannot be reconstructed locally.
Please, provide a complete demo, where the issue can be reproduced.
Here you can find a tutorial:
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hi,

I have tried to create a demo. But i cann’t create a xml document.
Because i retrive data from sql and convert to xml.
My issue is ‘mygrid.seralize()’ . it’ll retrive data incomplete format xml.
How i can retrive maxmium no.of record from xml? Its possible?

I have analysised more. But no idea.
How i can confrim it ‘Seralize data’ which is correct or not?

Note: rows (3000) & columns(137)

Please, provide any kind of sample of the init of your grid.

Hi sematik,

Is there any way to get the checked row and specified column alone???
Say if 1st row is checked i need to get the 1st row 5th column value.

I have around 3000 records and if all records are checked i need to get the 5th column of all rows and be serialized.

Can you please help me in this ASAP.

grid.attachEvent("onCheck", function(rId,cInd,state){ val=grid.cells(rId,5).getValue(); });

Hi sematik,

When large number of records are checked and clicked on button, we get script error. I tried to avoid the error and was able to get 3000 records and it’s size was around 8MB. So, we are not able to pass the file string to controller page.

function GridToXml() {
//count how many colums were submited from GRID
var colNum = mygrid.getColumnCount();
for (i = 0; i < colNum; i++) {
colLabel = mygrid.getColLabel(i);
// Delete header label is = “”
if (colLabel == “”) {
alert("Selected col Num - " + i);
var selectColNum = i;
var myXmlStr = mygrid.serialize();

    }
}

var values =
        {
            "ID": selectColNum,
            "Xml": escape(myXmlStr)
        }
       // alert('values'+values);
return values;

}

Its possible 8mb value to assign in string??

Its possible 8mb value to assign in string??
there is no limit for the string object.
But the limit may appear depending on the server settings and way the data is transmitted to the server.
stackoverflow.com/questions/5926 … size-limit

If the issue still occurs for you - please, provide a complete demo, where the issue can be reproduced.
here is the tutorial:
docs.dhtmlx.com/doku.php?id=othe … leted_demo

When we try to post the dhtmlx grid’s data which has 3000 rows and 137 columns the grid does not respond and gets hanged.
This is the expected behavior as it is really huge data. The serialize function works well for us in your application. The xml generates correctly. no js errors were noticed.

As per your response, you are try to say that we can’t able to post 3000 records with 137 columns to web server.
But in our case, when we post above 1MB data to server, System Get hanged.

Is there any other way to post 3000 records and 137 columns to web server without get any error.

According to your provided demo:
The serialize function works well for us in your application. The xml generates correctly. no js errors were noticed.
so dhtmlxgrid works correctly.
Please, check your web server settings.

Hi,

When we try to post the dhtmlx grid’s data which has 3000 rows and 137 columns the grid does not respond and gets hanged.

After that i tried to change the seralization

Check below code, i have reduced the grid to have 7 column (earlier it was 137 column) and 3000 rows to serialized

function GridToXml() {
//count how many colums were submited from GRID
var colNum = mygrid.getColumnCount();

//check which colum was selected 
for (i = 0; i < colNum; i++) {
    colLabel = mygrid.getColLabel(i);
    if (colLabel == "") {
        var selectColNum = i;
        mygrid.setSerializationLevel(false, false, false);
        mygrid.setSerializableColumns("true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false");
        var myXmlStr = mygrid.serialize();
        
    }
}

var values =
        {
            "ID": selectColNum,
            "Xml": escape(myXmlStr)
        }
return values;

}

We post the serialized value to server side and it will return message.
Suppose if 3000 record value has size minimum of 1MB value to post

But in our case, when we post above 1MB data to server, System Get hanged.

function doOnbtnClicked(controller, action) {
var values = GridToXml();
$.post(controller + ‘/’ + action + ‘/’, values, function (data) {

    alert('Post Values' + values);
    if (data.ErrorMessage) {
        $('#update').html(data.ErrorMessage + "<p><input type='button' id='btnOk' value='OK' onclick='errorHideReload();'></p>");
        $("#grayout").css("visibility", "visible");
        $("#update").css("visibility", "visible");
      

    }
 
});

}

web.config to include this code.
<system.webServer>





</system.webServer>

I’m tring to implement
1.7column and 3000 rows data to serialize.Its 1MB below
2.web.config to include web.server max contentLength
3.Checked 10 record out of 3000 record is post method working fine.

After than , We are facing below issue

  1. Searching 3000 record we got script error
    [I have attached the screen shot]
    2.After i checked first time , again we got script error.
    [I have attached the screen shot]
  2. Checked 10 record out of 3000 record is post method working fine.
  3. checked 100 record out of 3000 record is post method is ganged.

This is the expectable behavior that the process of serialization of 3000 or rows will take a significant time interval, the browser may identify that the script is hanging.
Unfortunately the performance of the serialization cannot be improved.

You may try to serialize on the changed (checked) rows with the following code:
mygrid.setSerializationLevel(false,false,false,false,true);
to increase the perfomance.

In our case, user might even select 3000 records and so all the rows will have to be part of Serialization. Please let us know the limitations / boundary conditions for the DHTML grid with respect to Serialization so that we can operate within that.

The limitation is not in the serialize method, and even not in the dhtmlx grid. The limitation is in the browser performance and system performance.
Your complete demo works correctly and fast enough for us with 7 columns.