XML Problem
Hi,
I need to parse the following XML to a grid to populate the xml values (Primary, Secondary etc) as Grid column headers.
<contacts>
<bus_contact0>Primary</bus_contact0>
<bus_contact1>Secondary</bus_contact1>
<bus_contact2>After Hours</bus_contact2>
<bus_contact3>Escalation</bus_contact3>
<tech_contact0>Primary</tech_contact0>
<tech_contact1>Secondary</tech_contact1>
<tech_contact2>After Hours</tech_contact2>
<tech_contact3>Escalation</tech_contact3>
</contacts>
device.setId('DataGrid');// device is the grid object
var table = new AW.XML.Table;
table.setAsync(false);
var str = '/cgi-bin/contacts_report.cgi';
table.setURL(str);
var table_response = table.response;
table.response = function(xml) {
table_response.call(this, xml);
alert(xml);//atleast I want to see the xml being parsed, so that I can make it to display as grid column header. But when I issue an alert statement, it shows blank(object).
get_data(device,table, 8);
}
table.request();
function get_data(field, xml,col){
var row = 0;
var cnt = 0;
alert(xml.getCount()); //prints 8, correct;
for (var i=0; i< xml.getCount(); i++){
alert(xml.getData(0, i));//prints nothing
field.setColumnCount(xml.getCount());
field.setHeaderText(xml.getData(0, i));
}
}
Can anyone please help me? I searched for similar issues, but to my bad luck could not find.
Thanks
Vijay
I need to parse the following XML to a grid to populate the xml values (Primary, Secondary etc) as Grid column headers.
<contacts>
<bus_contact0>Primary</bus_contact0>
<bus_contact1>Secondary</bus_contact1>
<bus_contact2>After Hours</bus_contact2>
<bus_contact3>Escalation</bus_contact3>
<tech_contact0>Primary</tech_contact0>
<tech_contact1>Secondary</tech_contact1>
<tech_contact2>After Hours</tech_contact2>
<tech_contact3>Escalation</tech_contact3>
</contacts>
device.setId('DataGrid');// device is the grid object
var table = new AW.XML.Table;
table.setAsync(false);
var str = '/cgi-bin/contacts_report.cgi';
table.setURL(str);
var table_response = table.response;
table.response = function(xml) {
table_response.call(this, xml);
alert(xml);//atleast I want to see the xml being parsed, so that I can make it to display as grid column header. But when I issue an alert statement, it shows blank(object).
get_data(device,table, 8);
}
table.request();
function get_data(field, xml,col){
var row = 0;
var cnt = 0;
alert(xml.getCount()); //prints 8, correct;
for (var i=0; i< xml.getCount(); i++){
alert(xml.getData(0, i));//prints nothing
field.setColumnCount(xml.getCount());
field.setHeaderText(xml.getData(0, i));
}
}
Can anyone please help me? I searched for similar issues, but to my bad luck could not find.
Thanks
Vijay
Vijay
January 7,