jQuery UI Widgets › Forums › Grid › Getting 'No Data to Display' w/large XML
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 11 years ago.
-
Author
-
I created a version of the grouping grid and it works great until I start loading a lot of data into the XML. Is there a limit to the number of element occurrences that can be placed in the XML data source? Below is a copy of the HTML source that I use. I can send a copy of the XML file if needed.
<!DOCTYPE html>
<html lang=”en”>
<head>
<title id=’Description’>On Order</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/jqxmenu.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.grouping.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.selection.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.sort.js”></script>
<script type=”text/javascript” src=”../../scripts/demos.js”></script>
<script type=”text/javascript”>
$(document).ready(function () {// prepare the data
var source =
{
datatype: “xml”,
datafields: [
{ name: ‘xPONumber’, map: ‘m\\:properties>d\\:xPONumber’, type: ‘string’ },
{ name: ‘xPOLine’, map: ‘m\\:properties>d\\:xPOLine’, type: ‘string’ },
{ name: ‘xClass’, map: ‘m\\:properties>d\\:xClass’, type: ‘string’ },
{ name: ‘xPOVendor’, map: ‘m\\:properties>d\\:xPOVendor’, type: ‘string’ },
{ name: ‘xStyle’, map: ‘m\\:properties>d\\:xStyle’, type: ‘string’ },
{ name: ‘xColor’, map: ‘m\\:properties>d\\:xColor’, type: ‘string’ },
{ name: ‘xSize’, map: ‘m\\:properties>d\\:xSize’, type: ‘string’ },
{ name: ‘xSKU’, map: ‘m\\:properties>d\\:xSKU’, type: ‘string’ },
{ name: ‘xDesc’, map: ‘m\\:properties>d\\:xDesc’, type: ‘string’ },
{ name: ‘xVendorName’, map: ‘m\\:properties>d\\:xVendorName’, type: ‘string’ },
{ name: ‘xDivNam’, map: ‘m\\:properties>d\\:xDivNam’, type: ‘string’ },
{ name: ‘xDept’, map: ‘m\\:properties>d\\:xDept’, type: ‘string’ }],
root: “entry”,
record: “content”,
id: ‘m\\:properties>d\\:RecId’,
url: ‘OnOrder.xml’
};
var dataAdapter = new $.jqx.dataAdapter(source);// Create jqxGrid
$(“#jqxgrid”).jqxGrid(
{
width: 1200,
source: dataAdapter,
groupable: true,
columns: [
{ text: ‘PO Number’, datafield: ‘xPONumber’, width: 95 },
{ text: ‘Line’, datafield: ‘xPOLine’, width: 37 },
{ text: ‘Class’, datafield: ‘xClass’, width: 40 },
{ text: ‘Vendor’, datafield: ‘xPOVendor’, width: 60 },
{ text: ‘Style’, datafield: ‘xStyle’, width: 40 },
{ text: ‘Color’, datafield: ‘xColor’, width: 40 },
{ text: ‘Size’, datafield: ‘xSize’, width: 40 },
{ text: ‘SKU’, datafield: ‘xSKU’, width: 90 },
{ text: ‘Item Desc’, datafield: ‘xDesc’, width: 200 },
{ text: ‘VendorName’, datafield: ‘xVendorName’, width: 200 },
{ text: ‘Div’, datafield: ‘xDivNam’, width: 200 },
{ text: ‘Department’, datafield: ‘xDept’, width: 200 }
],
groups: [‘xPONumber’]
});$(“#expand”).jqxButton({ theme: theme });
$(“#collapse”).jqxButton({ theme: theme });
$(“#expandall”).jqxButton({ theme: theme });
$(“#collapseall”).jqxButton({ theme: theme });// expand group.
$(“#expand”).on(‘click’, function () {
var groupnum = parseInt($(“#groupnum”).val());
if (!isNaN(groupnum)) {
$(“#jqxgrid”).jqxGrid(‘expandgroup’, groupnum);
}
});// collapse group.
$(“#collapse”).on(‘click’, function () {
var groupnum = parseInt($(“#groupnum”).val());
if (!isNaN(groupnum)) {
$(“#jqxgrid”).jqxGrid(‘collapsegroup’, groupnum);
}
});// expand all groups.
$(“#expandall”).on(‘click’, function () {
$(“#jqxgrid”).jqxGrid(‘expandallgroups’);
});// collapse all groups.
$(“#collapseall”).on(‘click’, function () {
$(“#jqxgrid”).jqxGrid(‘collapseallgroups’);
});// trigger expand and collapse events.
$(“#jqxgrid”).on(‘groupexpand’, function (event) {
var args = event.args;
$(“#expandedgroup”).text(“Group: ” + args.group + “, Level: ” + args.level);
});$(“#jqxgrid”).on(‘groupcollapse’, function (event) {
var args = event.args;
$(“#collapsedgroup”).text(“Group: ” + args.group + “, Level: ” + args.level);
});
});
</script>
</head>
<body class=’default’>
<div id=’jqxWidget’ style=”font-size: 13px; font-family: Verdana; float: left;”>
<div id=”jqxgrid”>
</div>
<div style=”margin-top: 30px;”>
<div style=”float: left; margin-left: 20px;”>
<input value=”Expand Group” type=”button” id=’expand’ />
<br />
<input style=”margin-top: 10px;” value=”Collapse Group” type=”button” id=’collapse’ />
<br />
<span style=”margin-top: 10px;”>Group:</span>
<input value=”1″ id=”groupnum” style=”margin-top: 10px; width: 20px;” type=”text” />
</div>
<div style=”float: left; margin-left: 20px;”>
<input value=”Expand All Groups” type=”button” id=’expandall’ />
<br />
<input style=”margin-top: 10px; margin-bottom: 10px;” value=”Collapse All Groups”
type=”button” id=’collapseall’ />
<br />
</div>
<div style=”float: left; margin-left: 20px;”>
<div style=”font-weight: bold;”>
<span>Event Log:</span>
</div>
<div style=”margin-top: 10px;”>
<span>Expanded Group:</span> <span id=”expandedgroup”></span>
</div>
<div style=”margin-top: 10px;”>
<span>Collapsed Group:</span> <span id=”collapsedgroup”></span>
</div>
</div>
</div>
</div>
</body>
</html>Hi RichDotson,
No, we do not add limits on the data loaded into the Grid. If you would like, we can test your scenario, but we will need the XML, too.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIs there a way to attach the file or email it to you? It is too large to cut/paste into the message.
Hi RichDotson,
You can send an e-mail with your sample including the xml file to support@jqwidgets.com.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comNever mind. I discovered that one of the elements had an ‘&’ in it and this was causing the ‘No Data to Display’ message. I made sure all my fields contained valid character data and the XML loaded correctly.
Hi RichDotson,
Thanks for the update. We were just about to contact you from support@jqwidgets.com. I see that you sent the sample and would like to thank you about that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.