How to put this code in datatable??? Any body could you help me??
How to put this code in datatable??? Any body could you help me??
vsverma11
Posts: 12Questions: 4Answers: 0
$(document).ready(function () {
//debugger;
$.ajax({
type: "POST",
url: "Default.aspx/GetXML",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
var data = $.parseJSON(data.d);
CreateTable(data);
//alert("Executed");
},
error: function (data) {
alert("Going in wrong direction");
}
});
});
function CreateTable(data) {
//}
//function PopulateItemsTable(data) {
var TableContents = "";
var InnerTable = "";
TableContents += "";
TableContents += "";
TableContents += "
";
$('#xmllist').append(TableContents);
//$('#xmllist').dataTable();
//alert('#xmllist');
}
Hotel Image | "; TableContents += "Hotel Name | "; TableContents += "Hotel Star | "; TableContents += "Hotel Address | "; TableContents += "Hotel Overview | "; TableContents += "|||||||
---|---|---|---|---|---|---|---|---|---|---|---|
"; TableContents += " | " + data[i].HOTEL_NAME + " | "; TableContents += "" + data[i].HOTEL_STAR + " | "; TableContents += "" + data[i].HOTEL_ADDRESS + " | "; TableContents += "" + data[i].Overview + " | "; TableContents += "|||||||
Room Type | "; TableContents += "";
InnerTable = "
| ";
TableContents += "
<div class="table table-striped">
<table id="xmllist" width="100%"></table>
</div>
This discussion has been closed.