Click here to Skip to main content
15,905,967 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
   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.
Posted
Comments
Torakami 12-Jun-15 2:30am    
this error generally comes because header table has more column than the data itself .

check if this is correct or not ?
prakash00060 12-Jun-15 4:20am    
sir please clear tell me the problem and how i fix it.

1 solution

The error tells you to go to http://datatables.net/tn/4[^] and that site explains what you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900