Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Bootstrap and server side processing

$
0
0
I have ran into a problem that I assume sDom could possibly fix but I am new to DataTables and would love some help. I have a code igniter app with DataTables and bootstrap integrated. The table headers are not DataTable default. All my tables look great until I needed to pull data back via server side. This table's headers seems to be the DataTable default even though my class is the same as the other tables. I have hard coded the headers but am allowing DataTables to draw the body. Everything looks great except the header row of the table. They spacing should be different and should have a white background and there should be no arrows. All these work great in my other DataTables but not when I am using server side processing. Can anyone help me with this? Unfortunately this is an internal app so I can't send anyone to look at the page. Some sample code would be great or a help with this fix.

Below is my code.


<table class="app-data-table table table-hover table-bordered table-condensed table-striped" id="transactions" >
			<thead>
				<tr>
					<th><small>Action</th>
					<th class="span4"><small>Facility Name</small></th>
					<th><small>Customer Code</small></th>
					<th><small>Check In Date</small></th>
					<th><small>Check In Time</small></th>
					<th><small>Check Out Date</small></th>
					<th><small>Check Out Time</small></th>
				</tr>
			</thead>
			<tbody>
				<?php echo $this->table->generate(); ?>
			</tbody>
			</table>

$(document).ready( function () {
	var oTable = $('#transactions').dataTable();
	oTable.fnDestroy();
	var oTable = $('#transactions').dataTable( {
		"bProcessing": true,
		"bServerSide": true,
		"sAjaxSource": '<?php echo base_url(); ?>index.php/transactions/datatable/',
    "bJQueryUI": true,
    "sDom": "<'row'<'span5'l><'span6'f>r>t<'row'<'span5'i><'span6'p>>",
    "sPaginationType": "bootstrap",
    "bSortClasses": false,
    "bProcessing": true,
    "sSearch": "Search all columns:",
	  "oLanguage": {
	      "sProcessing": "<img src='<?php echo base_url(); ?>_theme/images/processing-4.gif' width='150px'>"
	  },  
     'fnServerData': function(sSource, aoData, fnCallback)
      {
      	$.ajax
        ({
          'dataType': 'json',
          'type'    : 'POST',
          'url'     : sSource,
          'data'		: aoData,
       
          'success' : fnCallback
        });
      },
 	});
});//end document.ready



Viewing all articles
Browse latest Browse all 1816

Trending Articles