Im using DataTables (datatables.net) to display my data but when i add the sDom element, no data are loaded to the table.
The below code works
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#table_main').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo base_url()?>datatable.php"
});
});
</script>
although the tags are created that are given in the sDom, none of the data is loaded from he source. and also the button style which are given i fnInitComplete are not being applied
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#table_main').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo base_url()?>datatable.php",
"sDom": "<'dtTop'<'dtShowPer'l><'dtFilter'f>><'dtTables't><'dtBottom'<'dtInfo'i><'dtPagination'p>>",
"fnInitComplete": function(){
$(".dtShowPer select").uniform();
$(".dtFilter input").addClass("simple_field").css({
"width": "auto",
"margin-left": "15px"
});
}
});
});
</script>
any help on how to fix this error will be appreciated.
At first, documentation says nothing about subclass insertion, so try from working start point with such code (replace same line):
I dont have any code example with data (but u can provide some on pastebin.com or else), and code seems correct. So just add one rule in sDom and add one-by-one after checking if it works fine.