It sounds self explanatory, but it’s not. When my XML would not work, I got an example from the docs, https://docs.dhtmlx.com/tutorials__dhtmlxgrid_basic__step3.html It does not work either. I tried loading from a file and hard coding the xml into the JavaScript, no luck.
The app I am working on is old so because of other dependencies its trapped at JQuery v1.4 and version 2.6 of XGrid. I am not sure if that is a contributing cause.
So here is the sample page. What am I missing here?
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" language="Javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="xgrid/javascript/dhtmlxcommon.js"></script>
<script type="text/javascript" src="xgrid/javascript/dhtmlxgrid.js"></script>
<script type="text/javascript" src="xgrid/javascript/dhtmlxgridcell.js"></script>
<script type="text/javascript" src="xgrid/javascript/dhtmlxgrid_srnd.js"></script>
<script type="text/javascript" src="xgrid/javascript/dhtmlxgrid_splt.js"></script>
<script>
$(document).ready(function(){
mygrid = new dhtmlXGridObject("xgridTable");
mygrid.setHeader("Name,Quantity,Price");
mygrid.setInitWidths("200,150,150");
mygrid.setColAlign("left,right,right");
mygrid.setSkin("light");
xml = '<?xml version="1.0" encoding="iso-8859-1"?><rows><row id="a"><cell>book 1</cell><cell>300</cell><cell>50</cell></row><row id="b"><cell>book 2</cell><cell>2147</cell><cell>43</cell></row><row id="c"><cell>book 3</cell><cell>7488</cell><cell>100</cell></row></rows>';
mygrid.loadXML('data1.xml');
mygrid.init();
});
</script>
</head>
<body>
<div id='xgridTable'>xgridTable</div>
</body>
</html>