Datatable action only working on first page of table

Datatable action only working on first page of table

noureddine123noureddine123 Posts: 3Questions: 0Answers: 0
edited April 2014 in DataTables 1.10
I am using data table (bootstrap) and have a problem when I am goin to the second page. If I click on edit than there is no action. On the first page everything is working fine.

For two days I am trying to fixs this problem, but without any results. I am new to jQuery and Javascript.

Does anyone sees what is wrong with my code?


My html code is:

[code]


Test Table
Test table, with test data.






Rendering engine
Browser
Platform(s)
Engine version
CSS grade
Actions




Trident
Internet
Explorer 4.0
Win 95+
4
X







Trident
Internet
Explorer 5.0
Win 95+
5
C







Trident
Internet
Explorer 5.5
Win 95+
5.5
A








Gecko
Camino 1.5
OSX.3+
1.8
A







Gecko
Netscape 7.2
Win 95+ / Mac OS 8.6-9.2
1.7
A







Gecko
Netscape Browser 8
Win 98SE+
1.7
A








Presto
Opera 9.0
Win 95+ / OSX.3+
-
A







Presto
Opera 9.2
Win 88+ / OSX.3+
-
A







Presto
Opera 9.5
Win 88+ / OSX.3+
-
A







Presto
Opera for Wii
Wii
-
A







Presto
Nokia N800
N800
-
A









<!-- table-responsive -->
[/code]

Replies

  • noureddine123noureddine123 Posts: 3Questions: 0Answers: 0
    edited April 2014
    My jQuery code is:
    [code]

    jQuery(document).ready(function() {


    jQuery('#table2').dataTable({

    "sPaginationType": "full_numbers",

    "fnDrawCallback": function(){
    console.log("fnDrawCallback");
    }

    });

    // Chosen Select
    jQuery("select").chosen({
    'min-width': '100px',
    'white-space': 'nowrap',
    disable_search_threshold: 10
    });

    // Delete row in a table

    jQuery('.delete-row').click(function(){
    var c = confirm("Continue delete?");
    if(c)
    jQuery(this).closest('tr').fadeOut(function(){
    jQuery(this).remove();
    });

    return false;
    });



    // Show aciton upon row hover
    jQuery('.table-hidaction tbody tr').hover(function(){
    jQuery(this).find('.table-action-hide a').animate({opacity: 1});
    },function(){
    jQuery(this).find('.table-action-hide a').animate({opacity: 0});
    });


    });

    [/code]
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Two days could have been saved if you had just looked at the first question in the FAQs! http://datatables.net/faqs#events .

    Allan
  • noureddine123noureddine123 Posts: 3Questions: 0Answers: 0
    It's now working. Tnx!
This discussion has been closed.