is it possible to embed a html tag to data table based on ajax json?
is it possible to embed a html tag to data table based on ajax json?
jQuery('#datatable-responsive').DataTable({
dom: 'Bfrtip',
lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
],
ajax: {
url: '../modal/getClients.php',
dataSrc: 'aaData',
method:'POST'
},
columns: [
{ data:'client_name'},
{ data:'client_location'},
{ data:'client_region'},
{ data:'client_remarks'},
{ data:'client_status'}
],
select: true
});
here client_status have values 0,1,2,3 like , then based on that values i want to include an <label class=""></label> into <tr></tr> tag.
is it possible?
How?
or there is any another way?
Answers
According to mboo2005's comment here
you can use ajax.dataFilter option
i have an idea. please review it, if its bad ,,please suggest a good idea.
in my database client_status is 0,1,2,3.
in getClients.php file the corresponding html <label class='' ></label> is encoded in json.