Make datatable work for each table on the page, not just the first
This commit is contained in:
		
							parent
							
								
									8f28a444a2
								
							
						
					
					
						commit
						8aa1148f7a
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -49,12 +49,12 @@
 | 
				
			||||||
    <script src="{{ STATIC_URL }}datatables/js/dataTables.bootstrap.js" type="text/javascript"></script>
 | 
					    <script src="{{ STATIC_URL }}datatables/js/dataTables.bootstrap.js" type="text/javascript"></script>
 | 
				
			||||||
    <script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
 | 
					    <script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
 | 
				
			||||||
    <script type="text/javascript">
 | 
					    <script type="text/javascript">
 | 
				
			||||||
        $(function() {
 | 
					        $("table.table-reportdata").each(function () {
 | 
				
			||||||
        $("table.table-reportdata").dataTable({
 | 
					        $(this).dataTable({
 | 
				
			||||||
        "sDom": "<'row'<'col-md-3'l><'col-md-3'T><'col-md-4'f>r>t<'row'<'col-md-3'i><'col-md-5'p>>",
 | 
					        "sDom": "<'row'<'col-md-3'l><'col-md-3'T><'col-md-4'f>r>t<'row'<'col-md-3'i><'col-md-5'p>>",
 | 
				
			||||||
                "sPaginationType": "bootstrap",
 | 
					                "sPaginationType": "bootstrap",
 | 
				
			||||||
                "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
 | 
					 | 
				
			||||||
                "bStateSave": true,
 | 
					                "bStateSave": true,
 | 
				
			||||||
 | 
					                "aLengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
 | 
				
			||||||
                "oTableTools": {
 | 
					                "oTableTools": {
 | 
				
			||||||
                "aButtons": [
 | 
					                "aButtons": [
 | 
				
			||||||
                "copy",
 | 
					                "copy",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue