Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82109

checkall function does not work well with jquery1.9.1

$
0
0
my codes:
$(function(){
    var oTable = $('#dyntable').dataTable({
        "sPaginationType": "full_numbers",
	//"bStateSave": true,
	"aoColumnDefs": [
             { 
            	 "bSortable": false, 
            	 "bSearchable": false, 
            	 "aTargets": [0], 
            	 "sClass": "center", 
            	 "mRender": function(data, type, full){
            		 return '<input type="checkbox" name="seller[]" value="'+data+'">';
            	 } 
             },
         ],
        "bProcessing":true,
        "bServerSide": true,
        "sAjaxSource": "/user/sellerList"
    });

    /// check all
    $('.stdtable').on("click", '.checkall', function(){ // just work once
    //$('.stdtable .checkall').live("click", function(){// .live() is deprecated, it work well with jquery1.7.1 							   
	$('input', oTable.fnGetNodes()).attr('checked',this.checked);
    });
})

.live() is deprecated in jquery1.7+ but .on() does not work well.
Is there a good way to solve the version problem?

Viewing all articles
Browse latest Browse all 82109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>