在更改页面期间在Datatable中显示问题的值

时间:2017-03-04 12:34:50

标签: jquery twitter-bootstrap-3 datatables

在此表中,我使用的是datatable。对于附加功能,我使用复选框来显示隐藏sgst,igst,cgst数据。在第一次加载期间,将自动显示igst和cgst数据并单击sgst复选框数据将显示sgst。 问题:- 例如。 - 点击第2页分页菜单,然后点击sgst复选框,然后点击1分页菜单,然后sgst值不显示。作为替代方式。

注意:下面是复选框功能

  <script type="text/javascript">
    $(document).ready(function () {
        $('input[type="checkbox"]').click(function () {
            var inputValue = $(this).attr("value");
            $("." + inputValue).toggle();
        });
    });
</script>
 <div class="checkbox-list">
    <label class="checkbox-inline"> 
       <input type="checkbox" id="inlineCheckbox21" value="cgst" checked> CGST
    </label>
    <label class="checkbox-inline">
       <input type="checkbox" id="inlineCheckbox22" value="igst"  checked> IGST
    </label>
    <label class="checkbox-inline">
       <input type="checkbox" id="inlineCheckbox23" value="sgst"> SGST
    </label>
</div>

<table class="table table-striped table-bordered table-hover"
    id="sample_1" style="text-align: center;">
    <thead>
        <tr class="head-grey">
            <th rowspan="2">CPIN</th>
            <th rowspan="2">CPIN Date & Time</th>
            <th rowspan="2">GSTIN</th>
            <th rowspan="2">Bank Code</th>
            <th rowspan="2">Mode of Payment</th>
            <th rowspan="2">Amount</th>
            <th colspan="5" scope="colgroup" class="cgst">CGST</th>
            <th colspan="5" scope="colgroup" class="igst">IGST</th>
            <th colspan="5" scope="colgroup" class="sgst">SGST</th>
        </tr>
        <tr class="head-grey">
            <th class="cgst">Tax</th>
            <th class="cgst">Interest</th>
            <th class="cgst">Penalty</th>
            <th class="cgst">Fee</th>
            <th class="cgst">Others</th>
            <th class="igst">Tax</th>
            <th class="igst">Interest</th>
            <th class="igst">Penalty</th>
            <th class="igst">Fee</th>
            <th class="igst">Others</th>
            <th class="sgst">Tax</th>
            <th class="sgst">Interest</th>
            <th class="sgst">Penalty</th>
            <th class="sgst">Fee</th>
            <th class="sgst">Others</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>A</td>
            <td>B</td>
            <td>C</td>
            <td>D</td>
            <td>E</td>
            <td>F</td>
            <td class="cgst">30,000</td>
            <td class="cgst">100,000</td>
            <td class="cgst">80,000</td>
            <td class="cgst">50,000</td>
            <td class="cgst">3555550,000</td>
            <td class="igst">100,000</td>
            <td class="igst">8,000</td>
            <td class="igst">50,000</td>
            <td class="igst">30,000</td>
            <td class="igst">50,000</td>
            <td class="sgst">50</td>
            <td class="sgst">30,000</td>
            <td class="sgst">100,000</td>
            <td class="sgst">80,000</td>
            <td class="sgst">50,000</td>
        </tr>
        <tr>
            <td>A1</td>
            <td>B1</td>
            <td>C1</td>
            <td>D1</td>
            <td>E1</td>
            <td>F1</td>
            <td class="cgst">301,000</td>
            <td class="cgst">1055555555501,000</td>
            <td class="cgst">801,000</td>
            <td class="cgst">501,000</td>
            <td class="cgst">301,000</td>
            <td class="igst">1010,000</td>
            <td class="igst">81,000</td>
            <td class="igst">510,000</td>
            <td class="igst">310,000</td>
            <td class="igst">510,000</td>
            <td class="sgst">510</td>
            <td class="sgst">310,000</td>
            <td class="sgst">1010,000</td>
            <td class="sgst">810,000</td>
  <td class="sgst">510,000</td>
        </tr>
    </tbody>
</table>

0 个答案:

没有答案