urgent requirement - unable to load ajax response in table
urgent requirement - unable to load ajax response in table
Following is my js
$(document).ready(function() {
$.ajax({
url: url + 'project/get_project_list',
method:'post',
dataType:'xml',
success:function(data){
$('#datatable').dataTable({
data:data,
columns:[
{
"data" : "projectName"
},
{
data : "projectDescription"
},
]
});
}
});
});
$('#datatable').DataTable();
</script>
<div class="panel-wrapper">
<form id="form1">
<table id="datatable">
<thead>
<tr>
<th>Project Name</th>
<th>Project Description</th>
</tr>
</thead>
</table>
</form>
</div>
My response is as follows
<projectList>
<exceptionId>0</exceptionId>
<id>0</id>
<isException>false</isException>
<offExptionid>0</offExptionid>
<listException>false</listException>
<listExceptionId>0</listExceptionId>
<listSize>0</listSize>
<nextPage>false</nextPage>
<pageNumber>0</pageNumber>
<projectBOs>
<exceptionId>0</exceptionId>
<id>0</id>
<isException>false</isException>
<offExptionid>0</offExptionid>
<projectDescription></projectDescription>
<projectId>5</projectId>
<projectName>Bmw</projectName>
</projectBOs>
<projectBOs>
<exceptionId>0</exceptionId>
<id>0</id>
<isException>false</isException>
<offExptionid>0</offExptionid>
<projectDescription>Toyota</projectDescription>
<projectId>4</projectId>
<projectName>Toyota global</projectName>
</projectBOs>
<projectBOs>
Kindly help how could i bind projectname and projectdescription to the table .currently it says no data available in table. i have no idea in using datatables
Answers
Please link to a test case showing the issue, per the forum rules.
Allan