Hi there,
I just discovered jqGrid JS and it’s great, thanks! New to this forum, hope you can help me 🙂 I’m working with a local version (can’t go php) and an xml file that looks like that:
<rows>
<row id="1">
<cpro>00120</cpro>
<prot>Oui</prot>
<regl>Non</regl>
<fctfr>Ingénieur architecte</fctfr>
<fctnl>Ingenieur-architect</fctnl>
<syno></syno>
<etufr></etufr>
<axx></axx>
<axxlink>some url</axxlink>
<imtb>65</imtb>
<subdescfr>description1</subdescfr>
<subdescnl>description2</subdescnl>
</row>
</rows>
Is it possible to make a grid using this xml file and a subgrid using the same xml file but only with the tag <imtb>, <subdescfr> and <subdescnl>?
Also, my <axx> tag contains text and <axxlink> an URL. How can I output a column which shows something like axx?
This is what I got so far:
$("#jqGrid").jqGrid({
url: 'metiers.xml',
datatype: "xml",
loadonce: true,
sortname: 'cpro',
height: 475,
xmlReader: {
root:"rows",
row:"row",
repeatitems:false
},
colModel: [
{ label: 'Code', name: 'cpro', title:false, width: 50, xmlmap:"cpro", key:true },
{ label: 'Protégé', name: 'prot', title:false, width: 35, xmlmap:"prot", align:'center' },
{ label: 'Réglementé', name: 'regl', title:false, width: 35, xmlmap:"regl", align:'center' },
{ label: 'FR', name: 'fctfr', title:false, width: 150, xmlmap:"fctfr" },
{ label: 'NL', name: 'fctnl', title:false, width: 150, xmlmap:"fctnl" },
{ label: 'Synonyme', name: 'syno', title:false, width: 120, xmlmap:"syno" },
{ label: 'Etude FR', name: 'etufr', title:false, width: 100, xmlmap:"etufr" },
{ label: 'Brevet/Certif/Agrément/Org.Contrôle', name: 'axx', title:false, width: 150, xmlmap:"axx" },
{ label: 'Liens', name: 'axxlink', width: 150, formatter: 'link', hidden:true }
],
viewrecords: true,
caption: "Back Office Metiers",
rowNum: 20,
rowList: [10, 20, 30],
scroll: 1,
emptyrecords: 'Scroll to bottom to retrieve new page',
pager: "#jqGridPager"
});
Last but not least, my grid works like a charm in Internet Explorer and Firefox but not on Chrome. Chrome Console says this:
XMLHttpRequest cannot load file:///C:/Users/John/Desktop/BO%20M%C3%A9tiers/metiers.xml?_search=false&nd=1470475721571&rows=20&page=1&sidx=cpro&sord=asc.
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.send @ jquery-1.11.0.min.js:4
Thank you very much ( I’m not a pro with javascript as you can see 🙂 )
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top