Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dynamic data fetching in datatable.net

$(document).ready(function() {
            get_employees('all');
        });

        function get_employees(emp_type)
        {
            $.ajax({
                url: '../ajax_request.php',
                type: "POST",
                data: {
                    action: "admin_get_all_employees",
                    type: emp_type
                },
                success: function(response) {
                    var response = jQuery.parseJSON(response);

                    // $('#example').destroy(); tried this but haven’t worked
					
                    $('#example').dataTable({
                         destroy: true,
    					 aaData: response.data
                    });
                }
            });
        }
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript camel case to words 
Javascript :: hex decode javascript 
Javascript :: get output dir from webpack options 
Javascript :: extra reducer 
Javascript :: javascript string to date format dd/mm/yyyy 
Javascript :: python range equivalent in javascript 
Javascript :: how to print 1 to n numbers without using loop javascript 
Javascript :: counter random interval 
Javascript :: Error: listen EACCES: permission denied 5000; 
Javascript :: Example of Promise.any() and AggregateError in es12 
Javascript :: Paginate array in JavaScript 
Javascript :: on click disable esc button using jquery 
Javascript :: prevent the fire of parent event listener 
Javascript :: stimulus controller 
Javascript :: set value 
Javascript :: react native red Half Circle bubble 
Javascript :: random number between 0 and 50 then round to a whole number 
Javascript :: animateOut: "slideOutUp", animateIn: "slideInUp", not working 
Javascript :: if there is an invalid expression in eval js then how to get ti 
Javascript :: redirect to login when session expires jsf 
Javascript :: JS Recursive getLength of Array 
Javascript :: e.stopPropagation() is not working as expected 
Javascript :: moment js formating to one day less using zulu time 
Javascript :: how to make a popeyes chicken sandwich 
Javascript :: parent.containts js 
Javascript :: element vs node 
Javascript :: gsheet function argument a1notation 
Javascript :: how to regexp replace with uppercase on specific capture group in js 
Javascript :: freecodecamp Drop it 
Javascript :: react hooks link to external site new tab 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =