locked
How to Hide Table header by jquery RRS feed

  • Question

  • User-454825017 posted

    i attach jquery data table with my html table to get search textbox. this is my html table.

    <div class="card select_broker_wrapper">
        <div class="card-header">
            <input id="all-brokers" class="select_all" type="checkbox" value="all-brokers" name="all-brokers" title="Select All">
            <label for="all-brokers">Brokers</label>
        </div>
        <div data-simplebar="init"><div class="simplebar-wrapper">
    	<div class="simplebar-height-auto-observer-wrapper">
    	<div class="simplebar-height-auto-observer"></div>
    	</div><div class="simplebar-mask">
    	<div class="simplebar-offset" style="right: -17px; bottom: 0px;">
    	<div class="simplebar-content" style="padding: 0px; height: 100%; overflow: hidden scroll;">
    	
            <table id="tblBroker" class="dataTable">
                <tbody>
    			<tr class="tblBroker_head">
                <th>Broker Name </th>
                </tr>
                    <tr>
                            <td>
                                <input id="select-broker-1" class="clsBroker" checked="checked" type="checkbox">
                                    <label for="select-broker-1">Barclays Capital</label>
                                    <input type="hidden" id="shortname" value="Barclays Capital">
                            </td>
                        </tr>
            </tbody></table>
    
    
    </div>

    this is my jquery data table code from where i am trying to hide this element

                        $("#tblBroker").DataTable(
                            {
                                language: { search: "" },
                                searching: true,
                                bPaginate: false,
                                /*bInfo: false,*/
                                scrollCollapse: true,
                                ordering: true,
                                scrollX: true,
                                "fnInitComplete": function (oSettings) {
                                    $('.select_broker_wrapper').find('.tblBroker_head').hide();
                                }
                            });

    see this code specially which not hiding my table head

    "fnInitComplete": function (oSettings) {
          $('.select_broker_wrapper').find('.tblBroker_head').hide();
    }

    where i am making the mistake....give me a hint. thanks

    Wednesday, July 1, 2020 5:18 PM

Answers

All replies