function RefreshSearchResult(location, provider, reason, from, to, chartNumber) { debugger; var str = "{ strLocation:'" + location + "', strProvider: '" + provider + "', strReason: '" + reason + "', strFrom: '" + from + "', strTo: '" + to + "', strChartNumber: '" + chartNumber + "' }"; $.ajax ({ type: "POST", url: "AptSearchResult", contentType: "application/json; charset=utf-8", dataType: "json", data: str, success: function (data) { $('#myTable').dataTable(); $('#myTable_filter').css('display', 'none'); if (data.length > 0) { var row = ['<table id="myTable" class="table table-striped table-hover">\ <thead>\ <tr>\ <th><input type="checkbox" id="chkAll"></th>\ <th>Chart Number</th>\ <th>Reason To Visit</th>\ <th>Provider</th>\ <th>Location</th>\ <th>From</th>\ <th>To</th>\ </tr>\ </thead>\ <tbody>'].join('\n'); for (var i = 0; i < data.length; i++) { var item = data[i]; row += ["<tr>\ <td><input type='checkbox' class='tblcheck' value='" + item.AppointmentId + "' id='chk_" + item.AppointmentId + "'></td>\ <td>" + item.ChartNumber + "</td>\ <td><a href='#' data-toggle='modal' >" + item.Description + "</a></td>\ <td>" + item.Provider + "</td>\ <td>" + item.Location + "</td>\ <td>" + item.StartDate + "</td>\ <td>" + item.EndDate + "</td>\ </tr>"]; } row += ['</tbody>\ </table>']; $("#gridContent").html(row); $('#myTable').dataTable(); $('#myTable_filter').css('display', 'none'); } else { var row = ['<table id="myTable" class="table table-striped table-hover">\ <thead>\ <tr>\ <th><input type="checkbox" id="chkAll"></th>\ <th>Chart Number</th>\ <th>Reason To Visit</th>\ <th>Provider</th>\ <th>Location</th>\ <th>From</th>\ <th>To</th>\ </tr>\ </thead>\ <tbody>'].join('\n'); row += ["<tr class='odd'>\ <td valign='top' colspan='7' class='dataTables_empty' style='text-align:center'>No data available in table</td>\ </tr>"]; row += ['</tbody>\ </table>']; $("#gridContent").html(row); $('#myTable').dataTable(); $('#myTable_filter').css('display', 'none'); } } }); return false; } </script> it show the warning message (DataTables warning: table id=myTable - Requested unknown parameter '1' for row 0. For more information about this error, please see http://datatables.net/tn/4).I have to remove this message.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)