Forum







12:05

03/01/2012

Hi there,
I got heavy performance issues with the tabletogrid function. I try to convert a table with 325 records. It takes about 3 seconds to build the html table, but afterwards, when I try to convert it, it takes about 1.5 minutes. Is there a chance to improve the speed? It would be great, if anybody could give me some good advices.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="/smards_html/ui.jqgrid.css">
<link rel="stylesheet" type="text/css" href="/smards_html/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="/smards_html/jquery-ui.custom.css">
<link rel="stylesheet" type="text/css" href="/smards_html/searchFilter.css" />
<script type="text/javascript" language="JavaScript" src="/smards_html/jquery.js"></script>
<script type="text/javascript" language="JavaScript" src="/smards_html/jquery.transform.js"></script>
<script type="text/javascript" language="JavaScript" src="/smards_html/jquery.jqGrid.js"></script>
<script type="text/javascript" src="/smards_html/jquery-ui.js"></script>
<script type="text/javascript" src="/smards_html/grid.locale-de.js"></script>
<script type="text/javascript" src="/smards_html/grid.base.js"></script>
<script type="text/javascript" src="/smards_html/grid.common.js"></script>
<script type="text/javascript" src="/smards_html/grid.formedit.js"></script>
<script type="text/javascript" src="/smards_html/grid.celledit.js"></script>
<script type="text/javascript" src="/smards_html/grid.inlinedit.js"></script>
<script type="text/javascript" src="/smards_html/grid.custom.js"></script>
<script type="text/javascript" src="/smards_html/jquery.fmatter.js"></script>
<script type="text/javascript" src="/smards_html/jquery.searchFilter.js"></script>
<script type="text/javascript" src="/smards_html/grid.jqueryui.js"></script>
<script type="text/javascript">
$(test);
function test(){
$("#selectionTable tr").mouseover(function(){
$(this).addClass("highlight");
}).mouseout(function(){
$(this).removeClass("highlight");
}).click(function(){
$(this).addClass('selected');
$('#gridDIV').empty();
var vTable = $(this).children("td:first").text();
$.post('url…?IBIF_ex=GRDR001T&|V_TABLE='+vTable,function(titles){
$.post('url…?IBIF_ex=GRDR001C&|V_TABLE='+vTable,function(colMod){
$.post('url…?IBIF_ex=GRDR001&|V_TABLE='+vTable,function(data){
$('#gridDIV').transform({async:false,xmlstr:data,xsl:'url…test.xsl',complete:function(html,xsl,xml,transform){
$('#gridDIV').append('<div id="pagerDIV"></div>');
eval(colMod);
eval(titles);
// until here it takes about 2-3 seconds
tableToGrid($('#gridDIVTable'),{
autowidth: true,
ignoreCase: true,
height: '100%',
width: '100%',
pager: '#pagerDIV',
rowNum: 30,
rowList: [10,20,30],
rownumbers: true,
viewrecords: true,
gridview: true,
mtype: 'POST',
editurl: 'url…?IBIF_ex=GRDR001S',
caption: vTable,
colNames: vColNames,
colModel: vColModel
});
// until here about 2 minutes
}});
},'text');
},'text');
},'text');
});
}
</script>
</head>
<body id="ctsBody">
<table>
<tr>
<td>
<table id="selectionTable">
<tr>
<th>Tables</th>
</tr>
<tr>
<td>Test_table</td>
</tr>
</table>
</td>
<td>
<div id="gridDIV"></div>
</td>
</tr>
</table>
</body>
</html>
And here are some sample data:
13:52

Moderators
30/10/2007

Hello,
Sure it is possible. You have 3 nested ajax calls - please check these calls how long they are?
As simple as possible please test it without these ajax calls.
Not sure, but I think you should implement ajax queene.
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
23:13

02/12/2012

Not counting the nested ajax calls, I found this 'reworked' tabletogrid function that is a lot faster:
http://s339.codeinspot.com/q/1918992
It does however produces some disadvantages, for example column sorting doesn't seem to work anymore.
But it is surely faster if you only need to display a grid
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66