refresh datatable based on from to scope
refresh datatable based on from to scope
golovaty
Posts: 8Questions: 3Answers: 0
i have a table with huge amount of data
that's why i need
1) set a scope <from date> -<to date> with datepicker
2) send it to server
3) refresh datatable based on scope
can u pls give me some clues how to do it?
working example would be even better:)
(setting a scope is the only server side operation i need, i.e. i need not after that to use server side processing for datatable)
This discussion has been closed.
Answers
Use a date range filter?
https://www.datatables.net/plug-ins/filtering/row-based/range_dates
Tangerine
this would not work for me. this code handles a situation all data get loaded to client, in my case i need to say server first what data subset based on range to prepare and then load it into datatable.
i tried like:
$('#tdate').datepicker({
onSelect: function (date, instance) {
$.ajax
({
type: "Post",
url: "/api/options",
data: "date="+date,
success: function(result)
{
// alert(result);
optab.draw();
//optab.ajax.reload();
}
});
},
server side works fine and generates Json(response) but on client it nothing get refreshed.
the only scenario i see now to save picked date in server session and execute
optab.ajax.reload();
on return. sounds clumsy however
sorry here is a code formatted
```
server side works fine and generates Json(response) but on client is nothing get refreshed. the only scenario i see now to save picked date in server session and execute optab.ajax.reload(); on return. sounds clumsy however