DataTable for checkbox isant working

DataTable for checkbox isant working

TaniSantosTaniSantos Posts: 1Questions: 1Answers: 0
edited February 2019 in Free community support

Hello everyone, my name is Taniguchi and i used a code to put checkbox but the table didnt appear and even the checkbox, please help. i would like to know here i am failing
code:

 <table id="example" class="dataTables_wrapper" style="width:100%">
    <thead>
      <tr>
        <th>Recurso</th>
        <th>Função</th>
        <th>Projeto</th>
        <th>Tarefa</th>
        <th>Data</th>
        <th>Duração</th>
        <th>Comentário</th>
      </tr>
    </thead>
    <tfoot>
      {% for result in my_query.results.entities %}
      <tr> 
        <td><a href="https://apontamentodh.microsoftcrmportals.com/aprovarprojetoedit/?id={{result.msdyn_projectapprovalid}}">{{result.msdyn_bookableresource.name}}</a></td>
        <td>{{result.msdyn_resourcecategory.name}}</td>
        <td>{{result.msdyn_project.name}}</td>
        <td>{{result.msdyn_projecttask.name}}</td>
        <td>{{result.msdyn_date | date: 'dd/MM/yyyy'}}</td>
        <td>{{result.msdyn_costquantity | round:2}}</td>
        <td>{{result.msdyn_internalcomments}}</td>
      </tr>
      {% endfor %}
    </tfoot>
  </table>

  <script type="text/javascript" src="/dataTables.select.min.js"></script>
  <script type="text/css" src="/jquery.dataTables.min.css"></script>
  <script type="text/javascript" src="/jquery.dataTables.min.js"></script>
  <script type="text/javascript" src="/jquery-3.3.1.js"></script>
  <script type="text/css" src="/select.dataTables.min.css"></script>

<script>
   $(document).ready(function() {
     debugger;
    $('#example').DataTable( {
        columnDefs: [ {
            orderable: false,
            className: 'select-checkbox',
            targets:   0
        } ],
        select: {
            style:    'os',
            selector: 'td:first-child'
        },
        order: [[ 1, 'asc' ]]
    } );
} );
</script>

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @TaniSantos ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.