Я пытаюсь использовать свой собственный XML ниже .... я пытался загрузить его dhtmlxgrid, но это не кажется, загружается вdhtmlxgrid с помощью пользовательского XML
Я приложил файл пользовательского XML? Как я могу добавить пользовательский xml в dhtmlxgrid?
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxgrid.js"></script>
<script src="../../codebase/dhtmlxgridcell.js"></script>
<script src="../../codebase/ext/dhtmlxgrid_data.js"></script>
<script src="../../codebase/ext/dhtmlxgrid_data.js"></script>
<div id="gridbox" style="width:500px; height:270px; background-color:white;"></div>
<b>"xmlA"</b> format
<a href="javascript:void(0)" onclick="mygrid.xml.top='rows';mygrid.xml.row='./row';mygrid.clearAll();mygrid.load('php/xmlA.php','xmlA');">Reload grid from xml file in xmlA format</a><br/>
<br/>
<b>"xmlB"</b> format
<a href="javascript:void(0)" onclick="mygrid.xml.top='rows';mygrid.xml.row='./row';mygrid.clearAll();mygrid.load('php/xmlB.php','xmlB');">Reload grid from xml file in xmlB format</a>
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("Column A, Column B,Column C");
mygrid.setInitWidths("80,200,*");
mygrid.setColAlign("right,left,left");
mygrid.setColTypes("dyn,ed,ed");
mygrid.setColSorting("int,str,str");
mygrid.setColumnIds("first,second,third");
/*mygrid.xml.top = "mytop";
mygrid.xml.row = "./myrow";*/
mygrid.xml.top = "Root";
mygrid.xml.row = "./AuditTrail";
mygrid.xml.cell="./Time";
mygrid.xml.cell="./UserID";
mygrid.xml.cell="./Type";
mygrid.xml.cell="./Description";
mygrid.xml.cell="./val0";
mygrid.init();
mygrid.setSkin("dhx_skyblue");
mygrid.load("../common/audit.xml", "xml");
//mygrid.load("../common/custom.xml", "xml");
</script>
XML файл
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<AuditTrail>
<Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
<UserID>DX</UserID>
<Type>FY [REC]</Type>
<Description>Server: wamp</Description>
<val0>1</val0>
</AuditTrail>
<AuditTrail>
<Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
<UserID>DX</UserID>
<Type>FY [REC]</Type>
<Description>Server:tomcat</Description>
<val0>1</val0>
</AuditTrail>
<AuditTrail>
<Time>2012-01-10 09:27:30 (GMT-05:00)</Time>
<UserID>DX</UserID>
<Type>FY [REC]</Type>
<Description>Server: apache</Description>
<val0>1</val0>
</AuditTrail>
/Root>