targeting xml grandchildren
NEWBIE Blonde moment!
I have a xml document (static) that I need to test what is in a grand child element. The real application is a jqGrid. I have a onSelectRow operation going on. I can click on a row and get a response (in a alert window) for any root children. But how do I do this for anything deeper in the tree? A portion of my xml is attached.
Here is my onSelectRow function:
- onSelectRow: function() {
var gsr = $('#searchResults').jqGrid('getGridParam', 'selrow');
if (gsr) {
var data = $('#searchResults').jqGrid('getRowData', gsr);
$('#basicMun h3').append("DODIC: " + data.dodic + "Nomenclature: " + data.nomenclature),
.append("Use: " + data.use + "Description: " + data.description)
.append("Length: " + data.objLength + "Width: " + data.objWidth);
alert(data.performance > velocity > unit);
}
}
I can always get a response in the alert box when I access things like dodic, nomenclature, use, etc. But my code breaks/freezes when I try and target things such as <unit> within elements like <objLength>. I have tried the above alert line and also alert(data.objLength.unit);, but neither one works.
Tony
It is not the job you get handed, but what you have done with it in the end that people remember.