refresh datatable based on from to scope

refresh datatable based on from to scope

golovatygolovaty 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)

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394
  • golovatygolovaty Posts: 8Questions: 3Answers: 0

    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.

  • golovatygolovaty Posts: 8Questions: 3Answers: 0

    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

  • golovatygolovaty Posts: 8Questions: 3Answers: 0

    sorry here is a code formatted

    i tried like:
    
          $('#tdate').datepicker({
                onSelect: function (date, instance) {
                    //$('#doFilter').submit();
    
                    $.ajax
                    ({
                        type: "Post",
                        url: "/api/options",
                        data: "date="+date,
                        success: function(result)
                        {
                            alert(result);
    
                         //   optab.ajax.reload();
                            optab.draw();
                        }
                    });  
    

    ```
    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

This discussion has been closed.