• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 52
  • Last Modified:

PHP + Datatable options

I am trying to change the options for a datatable, using the example from datatables.net, but not matter what I try it doenst work.  the only option that is working is the hiding of the data for the first value - can someone tell me where I am going wrong.

		<script type="text/javascript" language="javascript" >

				$(document).ready(function() {
						var dataTable = $('#availgames-grid').DataTable({
								"scrollY":        "200px",
							 "scrollCollapse": true,
								"paging":         false,
								"language": [{
										"emptyTable": "No Games Available, Check Back Soon.",
										"infoEmpty": "No entries to show"
        				}],
								"columnDefs": [{
										"targets": [0],
										"visible": false,
										"searchable": false
								}],
								responsive: {
										details: {
												renderer: function(api, rowIdx) {
														var data = api.cells(rowIdx, ':hidden').eq(0).map(function(cell) {
																var header = $(api.column(cell.column).header());
																return '<p style="color:#00A">' + header.text() + ' : ' + api.cell(cell).data() + '</p>';
														}).toArray().join('');

														return data ? $('<table/>').append(data) : false;
												}
										}
								},
								processing: true,
								serverSide: true,
								ajax: "availgames-grid-data.php", // json datasource
						});
				});
		</script>

Open in new window

0
dkilby
Asked:
dkilby
1 Solution
 
lenamtlCommented:
Hi,

Can you set a Jsfiddle for this so I can see the problem?

First check if you have any error in console Chrome right click Inspect.

Most of the time with Responsive is that other options can be in conflict with
like fixed width, scroll, collapsed

So what you can do is to keep the minimum settings by removing scrollCollapse and scrollY and try new settings one by one to found the problem.

Also maybe the problem is with your datatabase query or other JS on the pages
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now