Sameer Vishwajit Sachin Source ML FO Data ML FO Data ML FO Data TCS 10 20 30 5 8 9 4 5 6 WIPRO 20 24 26 8 9 7 5 6 3 GODREJ 30 25 24 8 4 8 6 4 5
I have Tried ..... HTML Page Code is <table id="tbDetails" class="display; cell-border"> <thead></thead> <tbody></tbody> </table> Jquery Code is ..... $.ajax({ url: "testing.asmx/Customize_Datatable", type: "POST", dataType: "json", crossDomain: true, success: function (data) { $('#tbDetails').dataTable({ data: data, "bInfo": false, //Dont display info e.g. "Showing 1 to 4 of 4 entries" "paging": false,//Dont want paging "bPaginate": false,//Dont want paging "bFilter": false, //hide Search bar "bSort": false, "orderCellsTop": true, }); }, error: function (jqXHR, textStatus, errorThrown) { alert('error: ' + textStatus + ': ' + errorThrown); } }); And Webservice Code is [WebMethod] [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)] public void Customize_Datatable() { try { String Query = "<table id = 'tbDetails' class='display' style='width:100%'> " + " <thead> " + " <tr> " + " <th> Name </th> " + " <th> Position </th> " + "<th> Office </th> " + "<th> Age </th> " + "<th> Start date </th> " + " <th> Salary </th> " + " </tr> " + " </thead>" + "<tbody> " + "<tr> " + "<td> Tiger Nixon </td> " + "<td> System Architect </td> " + "<td> Edinburgh </td> " + "<td> 61 </td> " + "<td> 2011 / 04 / 25 </td> " + "<td>$320,800 </td> " + "</tr> " + " </tbody> " + "</table> "; // return Query; JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(Query)); } catch (Exception ex) { throw ex; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)