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

How to incorporate Datatable in JQuery Onclick Function

$
0
0

I have an li

<li id="clientshowall"><a href="#"><span>Show All Clients</span>

// This Function retrieves all the Clients from my mysql database.

$(function(){
$("#clientshowall").on('click', function(){
$.ajax({
method: "GET",
url: "client_tables.php",
}).done(function( data ) {
var result= $.parseJSON(data);
var string='

'; /* from result create a string of data and append to the div */ $.each( result, function( key, value ) { string += ""; }); string += '
customer NumberFirst Name Last Name Email Address Cell Phone
"+value['customer_number']+ "" +value['first_name']+ "" +value['last_name']+ "" +value['email']+ " " +value['primary_phone']+ "

';
$("#payments").html(string);
});
});
});

See Attached of the table.

I would like to use datatables in the above function, but I do not know how to incorporate into this function. If some one caould give me a pointer I would be most appreciative.

thanks


Viewing all articles
Browse latest Browse all 82000

Trending Articles



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