jQuery UI Widgets › Forums › Grid › A lot of data to represet
Tagged: data, grid, jqxgrid, JSONP, large, rendergridrows, virtual mode, virtualmode
This topic contains 7 replies, has 2 voices, and was last updated by Dimitar 10 years, 8 months ago.
-
Author
-
I would like to retrieve a lot of data throw jsonp callback, but I want that it will be in stream of chunk.
That imminently when I open the page I will see the first chunk of data and it will continue load it during the rest of the timeHello lev_povolotsky,
Please consider using virtual mode.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I don’t succeed
I use that code but instead with jsonp and I don’t succeed.
please help meI took exactly that
<!DOCTYPE html>
<html lang=”en”>
<head>
<title id=’Description’>In this example the Grid is bound to a Remote Data.</title>
<link rel=”stylesheet” href=”/jqwidgets/styles/jqx.base.css” type=”text/css”/>
<script type=”text/javascript” src=”/scripts/jquery-1.10.2.min.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxlistbox.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxdropdownlist.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxmenu.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.pager.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.sort.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.filter.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.columnsresize.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxgrid.selection.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxpanel.js”></script>
<script type=”text/javascript” src=”/jqwidgets/jqxdatatable.js”></script>
<script type=”text/javascript” src=”/scripts/demos.js”></script>
<script type=”text/javascript”>
$(document).ready(function () {
var source =
{dataType: “jsonp”,
datafields : [
{ name: ‘CompanyName’},
{ name: ‘ContactName’},
{ name: ‘ContactTitle’},
{ name: ‘Address’},
{ name: ‘City’},
{ name: ‘Country’}
],
id: ‘runId’,
url: “http://localhost:9998/test/runs”
};var dataAdapter = new $.jqx.dataAdapter(source, { async: false, autoBind: true });
var records = dataAdapter.records;
// UI Stuff
$(“#jqxgrid”).jqxGrid(
{
width: 1200,
height: 850,
source: dataAdapter,
theme: theme,virtualmode: true,
rendergridrows: function (params) {
var start = params.startindex;
var end = params.endindex;
var array = new Array();
for (i = start; i < end; i++) {
array[i] = records[i];
}
return array;
},
columns: [
{ text: ‘Company Name’, datafield: ‘CompanyName’, width: 250 },
{ text: ‘Contact Name’, datafield: ‘ContactName’, width: 200 },
{ text: ‘Contact Title’, datafield: ‘ContactTitle’, width: 200 },
{ text: ‘Address’, datafield: ‘Address’, width: 180 },
{ text: ‘City’, datafield: ‘City’, width: 100 },
{ text: ‘Country’, datafield: ‘Country’, width: 140 }
]
});});
</script>
</head>
<body class=’default’>
<div id=’jqxWidget’ style=”font-size: 13px; font-family: Verdana; float: left;”>
<div id=”jqxgrid”></div>
</div>
</body>
</html>just changed the fields and used jsonp
please help me to modify that.
Hi lev_povolotsky,
The dataAdapter.records array has not yet been populated when you set records. Try:
for (i = start; i < end; i++) { array[i] = dataAdapter.records[i]; }
Also, you do not need
autoBind: true
when you are using the data adapter with jqxGrid. For another example, please check out the demo Grid Server Paging.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I made that instead and
virtualmode: true, rendergridrows: function (params) { var start = params.startindex; var end = params.endindex; var array = new Array(); array = params.data; return array; }
The issue is that I had more then 7000 rows but it gave me just twice to scroll first time for 0 index-36 index and second time from 3 index till 41 index and that all why its happened?
any suggestion?
Hi lev_povolotsky,
And did the first approach (getting rows from the data adapter) work?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.