Hi i want to read all the option value present in this xml file and show them on table file i am using this code but it is not working. var data = [];//We'll fill this table after the xml has loaded var tableView = Titanium.UI.createTableView({ data:data })
function errorMessage(){ alert("Well, that didn't work"); }
function renderXML(){ var tours = this.responseXML.documentElement; var tour = tours.getElementsByTagName("select");
//traverse the tour node, pull out the titles
for(var i=0; i<tour.length;i++){
var item = tour.item(i);
var title = item.getElementsByTagName("selectTitle").item(0).text;
var row = Titanium.UI.createTableViewRow({
title:title,
className:"tableRow",
});
data.push(row);
}
tableView.setData(data);
}
var xhr = Titanium.Network.createHTTPClient({ onload: renderXML, onerror: errorMessage });
employeewin.add(tableView);
xhr.open("GET","http://afghanskills.com/employee-index.php?JAID=151&action=del#employee-menu-title.php"); xhr.send();
the xml which i want to read is <select name="TargetIndustry[]" style="height:100px;" multiple="multiple" class="form-input-field" id="TargetIndustry"> <option value="1">Accounting, Auditing</option> <option value="2">Agriculture, Poultry, Forestry & Fishing</option> <option value="3">Automobile & Automotive</option> <option value="4">Biotechnology & Pharmaceutical</option> <option value="5">Data Entry/BPO/Others</option> <option value="6">Engineering, Architectural & Real Estate</option> <option value="7">Government & Military</option> <option value="8">Hotel & Restaurant</option> <option value="9">Manufacturing & Production</option> <option value="10">Merchandising & Buying House</option> <option value="11">Research/Consultancy</option> <option value="12">Textiles & Garments</option> <option value="13">Administration & Human Resource</option> <option value="14">Arts, Entertainment, Sports & Media</option> <option value="15">Banking, Insurance & Finance</option> <option value="16">Computing & Information Technology</option> <option value="17">Education, Teaching, Training & Library</option> <option value="18">General</option> <option value="19">Health Care & Hospitality</option> <option value="20">Law & Legal Services </option> <option value="21">Marketing, Advertising & Public Relation</option> <option value="22">NGO & Customer Services </option> <option value="23">Telecommunication</option> <option value="24">Travel, Transportation & Tourism</option> </select>
Your Answer
Think you can help? Login to answer this question!