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

Set date with datepicker and reload table from server with selected date as a filter

$
0
0
Hi Allen,

I am using DataTables on my page. Now I have included a datepicker element to use it for selecting a date.
The selected date should be sent to the server where to use the date as a filter. The table should then be reloaded with the filtered json data.

Here is my code:

$(function() {
$( "#datepicker" ).datepicker({
						altField: "#alternate",
						altFormat: "DD, d MM, yy",
						onSelect: function(dateText) {
							$('#container').load('ServletToLoad?time_tracking=' + dateText);
						}
						
					});
				});

What I get is pure json on my page instead of just populating the table with the reloaded data. Can you see what is going wrong here?

Kind regards

Gunter

Viewing all articles
Browse latest Browse all 1816

Trending Articles