Forum



21:16

12/04/2010

DEAD ISSUE for the moment... NEEd to solve just getting data into grid first.
I have an xml document which uses the xml element attritubute, such as the "dodic" in the following example:
<chemical dodic="k866″>
<weaponType>smoke</weaponType>
</chemical>
I am trying to set up my jqGrid to be able to use element attributes, either in the xmlReader or colModel portion of the script. Looking through the documentation, I don't see an example of how it is accomplished. I am using static xml document as my data source. If I need to restructure the xml to move this attribute into its own element, I would like to do it now.
Does anyone have a suggestion??
Here is my controller script:
$('#chem li').click(function() {
$('#welcome').css('display', 'none');
$('#searchResults').jqGrid({
url: 'weaponLib/AME_chem.xml',
datatype: 'xml',
colNames:["DODIC","NSN", "Nomenclature"],
colModel:[
{name:"dodic",index:"dodic", width:120, xmlmap:"ItemAttributes>Author"},
{name:"NSN",index:"NSN", width:180,xmlmap:"chemical>transData>NSN"},
{name:"nomenclature",index:"nomenclature", width:100, align:"right",xmlmap:"chemical>nomenclature", sorttype:"float"}
],
height:250,
width: 700,
rowNum:10,
rowList:[10,20,30],
viewrecords: true,
loadonce: true,
xmlReader: {
root : "chemicals",
row: "chemical",
repeatitems: false,
id: "ASIN"
},
caption: "Chemical Weapon Results"
});
$('#theGrid').css('display', 'block');
});
Tony
12:58

Moderators
30/10/2007

Hello,
Did you have read:
XML Notes and Limitations
in the docs here:
http://www.trirand.com/jqgridw.....imitations
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
100 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66