Forum



13:20

02/06/2011

Hello
I've tried to display a virtual scroll through more data than 50,000,000 lines can not scroll work.
When I move the slider of the scroll bar to display the page location is invalid.
jqGrid a bug?, please tell me how to bugfix.
jQuery("#scroll").jqGrid({
url:'dataReader.php',
datatype:"json",
height:750,
width:1120,
altRows:true,
shrinkToFit:false,
colNames:[…,…,…,…,…,…],
colModel:[…,…,…,…,…,…],
rowNum:100,
rowList:[40,60,100],
scroll:1,
loadonce:false,
mtype:"GET",
rownumbers:true,
rownumWidth:70,
gridview:true,
pager:'#pscroll',
viewrecords:true,
caption:''
});
19:16

04/01/2010

09:20

Moderators
30/10/2007

Hello,
The problem of more than 500 000 records lie in the browsers limitations itself and the way we realize virtual scrolling.
The problem is hard to be fixed, but I think this is not impossible. This requiere a lot of eforts and calculations.
Kind 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.
01:06

04/01/2010

16:59

02/06/2011

Hello,
This is my test program. Please refer to the huge test data.
---index.html ----------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Virtual scrolling Test</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/jquery-ui.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.multiselect.css" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery-ui.custom.min.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/ui.multiselect.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#scroll").jqGrid({
url:'testData.php',
datatype:"json",
height:750,
width:600,
altRows:true,
shrinkToFit:false,
colNames:['Index','Name','Code'],
colModel:[
{name:'item_id',index:'item_id', width:65, sorttype:'int'},
{name:'item',index:'item', width:150},
{name:'item_cd',index:'item_cd', width:100}
],
rowNum:100,
rowList:[40,60,100],
scroll:1,
loadonce:false,
mtype:"GET",
rownumbers:true,
rownumWidth:70,
gridview:true,
pager:'#pscroll',
viewrecords:true,
caption:'Huge DataGrid'
});
jQuery("#scroll").jqGrid('navGrid','#pscroll',{del:false,add:false,edit:false},{},{},{},{multipleSearch:true});
});
</script>
</head>
<body>
<table id="scroll"></table>
<div id="pscroll"></div>
</body>
</html>
--- testData.php ----------------------------------------------------------------
<?php
$page = $_REQUEST['page']; // get the requested page
$limit = $_REQUEST['rows']; // get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx']; // get index row - i.e. user click to sort
$sord = $_REQUEST['sord']; // get the direction
if(!$sidx) $sidx =1;
$totalrows = isset($_REQUEST['totalrows']) ? $_REQUEST['totalrows']: false;
if($totalrows) {
$limit = $totalrows;
}
//data count
//$count = 5000000; // OK
//$count = 5500000; // OK
//$count = 6000000; // NG
//$count = 7000000; // NG
$count = 50000000; // NG
//$count = 500000000; // NG
//$count = 2000000000; // NG
if( $count > 0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
if ($limit<0) $limit = 0;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
if ($start<0) $start = 0;
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$dc = $limit;
$rdc = $count - $start;
if ($dc > $rdc) {
$dc = $rdc;
}
for ($ir = 0; $ir < $dc; $ir++) {
$n = $start + $ir + 1;
$row[item_id] = 'item_id ' .$n;
$row[item] = 'item ' .$n;
$row[item_cd] = 'item_cd ' .$n;
$responce->rows[$ir]['id']=$row[item_id];
$responce->rows[$ir]['cell']=array($row[item_id],$row[item],$row[item_cd]);
}
echo json_encode($responce);
?>
Most Users Ever Online: 715
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 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