datatables for jquery version 2.1.1

datatables for jquery version 2.1.1

I am wandering over the site of how to get this plug-in to use in my code.
I am using jquery 2.1.1. Why datatables is not supported for latest jquery versions?

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    It does. The current release of DataTables is compatible with jQuery 1.7+.

    Allan

  • katkam.rachana@gmail.comkatkam.rachana@gmail.com Posts: 5Questions: 2Answers: 0
    edited January 2015

    Is it? Because my code is not working when I add datatables to it.
    How can I get it resolved? Where can I post my code for help? Any idea?

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Yes it is. Example with jQuery 2.1.1.

    If it isn't working for you, please link to a test case showing the issue as required in the forum rules.

    Allan

  • katkam.rachana@gmail.comkatkam.rachana@gmail.com Posts: 5Questions: 2Answers: 0

    Ok so I have this following code:

    <!DOCTYPE html>
    <html>
      <head>
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
        <link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" />
        <script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script>
    
        <script type="text/javascript">
        $(document).ready( function () {
          var table = $('#table_data').DataTable();
        } );
        </script>
    
        <meta charset=utf-8 />
        <title>DataTables - JS Bin</title>
      </head>
    
      <body>
        <table align="center" id="table_data">
          <thead>
            <tr>
              <th>A</th>
              <th>B</th>
              <th>C</th>
            </tr> 
          </thead>
        
          <tbody>
            <tr>
              <td>a</td>
              <td>b</td>
              <td>c</td>
            </tr>
            <tr>
              <td>a1</td>
              <td>b1</td>
              <td>c1</td>
            </tr>
            <tr>
              <td>a2</td>
              <td>b2</td>
              <td>c2</td>
            </tr>
          </tbody>
        </table>
      </body>
    </html>
    
    

    which is workiing properly on http://live.datatables.net/ but not through my project.

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    I don't know why it is not working on your project. Sorry. I would need a link to the page to be able to debug it.

    Allan

  • katkam.rachana@gmail.comkatkam.rachana@gmail.com Posts: 5Questions: 2Answers: 0

    Its working now.
    I was importing datatables plugin before jquery, hence was an issue.

This discussion has been closed.