Configuration with Searching and Info

Configuration with Searching and Info

midlandmidland Posts: 15Questions: 2Answers: 0

Hi Allen,

My dataTable has multiple pages and I don't want "searching" and "show display entries" boxes to be displayed. I tried configuration. both did not work. ""iDisplayLength" works. Please let me know how I disable them.

Below id my script:

$(document).ready(function () {
$('#bradfordTable').dataTable({
"iDisplayLength": 24,
"info": false,
"searching": false
//"sPaginationType": "full_numbers"
});
});

I tried
$.extend($.fn.dataTable.defaults, {
"info": false,
"searching": false
});

It did not work either.

Thanks very much for your help.

Answers

  • allanallan Posts: 54,897Questions: 1Answers: 8,605 Site admin

    Can you please link to a test case, as required in the forum rules, in future.

    It seems to work just fine for me: http://live.datatables.net/figadug/1/edit , so there is something wrong with your usage, but without a test case, I can't even begin to guess what it is.

    Allan

  • midlandmidland Posts: 15Questions: 2Answers: 0

    Hi Allan,

    Thanks for your reply. I saw your example but the same configuration did not work for me. Bellow is full html file: I can not provide a webpage to you since it is intranet.
    Thanks again for your help.

    @model IEnumerable<BradfordUtilityNew.ViewModels.PlateDisplayData>

    @section scripts{
    <link href="~/Content/DataTables-1.9.4/media/css/demo_table_jui.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.min.js"></script>
    <link href="~/Content/DataTables-1.9.4/media/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(document).ready(function () {
            $('#bradfordTable').dataTable({
                "iDisplayLength": 24,              
                "info": false,
                "searching": false
             });
        });
    </script>
    

    }
    <!DOCTYPE html>

    <html>
    <body>
    <h2>Bradford Plates</h2>
    <div id="bradford">
    <table id="bradfordTable" border="0" cellpadding="0" cellspacing="0" class="display" style="white-space:nowrap">
    <thead>
    <tr>
    <th>ID</th>
    <th>Coef_A</th>
    <th>Coef_B</th>
    <th>Coef_C</th>
    <th>pgul<br>curve</th>
    <th>Rep<br>curve</th>
    <th>OD_curve</th>
    <th>Predpg<br>curve</th>
    <th>Percent<br>error<br>curve</th>
    <th>Mean_percent_<br>error_curve</th>
    <th>Mean_percent<br>error_curve<br>limit</th>
    <th>Replicate<br>outlier</th>
    <th>Level<br>outlier</th>
    <th>Level_pf<br>curve</th>
    <th>Pf<br>curve</th>
    <th>Level<br>ref_ctl</th>
    <th>Rep<br>ref<br>ctl</th>
    <th>OD_ref_ctl</th>
    <th>Actural<br>predpg<br>ref_ctl</th>
    <th>Target<br>predpg<br>ref_ctl</th>
    <th>LCL_ref_ctl</th>
    <th>UCL_ref_ctl</th>
    <th>Rep_PF<br>ref_ctl</th>
    <th>Level_PF<br>ref_ctl</th>
    <th>Computer</th>
    <th>Operator</th>
    <th>Date</th>
    <th>Time</th>
    </tr>
    </thead>
    <tbody>
    @foreach (var item in Model)
    {
    <tr>
    <td>@item.PlateID</td>
    <td>@item.Fit_Coef_A</td>
    <td>@item.Fit_Coef_B</td>
    <td>@item.Fit_Coef_C</td>
    <td>@item.pgul_curve</td>
    <td>@item.Rep_curve</td>
    <td>@item.OD_curve</td>
    <td>@item.Predpg_curve</td>
    <td>@item.Percent_error_curve</td>
    <td>@item.Mean_percent_error_curve</td>
    <td>@item.MeanPctErrorLimit</td>
    <td>@item.Replicate_outlier</td>
    <td>@item.Level_outlier</td>
    <td>@item.Level_pf_curve</td>
    <td>@item.Pf_curve</td>
    <td>@item.Level_ref_ctl</td>
    <td>@item.Rep_ref_ctl</td>
    <td>@item.OD_ref_ctl</td>
    <td>@item.Actual_predpg_ref_ctl</td>
    <td>@item.Target_predpg_ref_ctl</td>
    <td>@item.LCL_ref_ctl</td>
    <td>@item.UCL_ref_ctl</td>
    <td>@item.Rep_PF_ref_ctl</td>
    <td>@item.Level_PF_ref_ctl</td>
    <td>@item.Computer</td>
    <td>@item.Operator</td>
    <td>@item.Date_Run</td>
    <td>@item.Time_Run</td>
    </tr>
    }
    </tbody>
    </table>
    </div>
    </body>
    </html>

This discussion has been closed.