Not able to load ajax json data into DataTables - Page 2

Not able to load ajax json data into DataTables

2»

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Yes - I din't know what your markup was (this is why a link to a test case is so important). The serialise documentation says:

    > The .serialize() method creates a text string in standard URL-encoded notation.

    So the name prefixed is completely expected. That is how jQuery works. As I say, nothing to do with DataTables.

    Allan
  • BernardABernardA Posts: 21Questions: 0Answers: 0
    Allan

    This is the solution I found to have the actual value rather than a serialized representation input into DT.
    Everything is working now after this long slug. I will go out and celebrate!!
    Thanks again for your patience.
    [code]

    $(document).ready(function() {
    var str = [];
    oTable = $("#myTable").dataTable({
    "fnServerParams": function (aoData) {
    aoData.push({ name:'str', value:str });}
    });

    $("#filter").change(function(){
    str=[];
    $('#filter :checked').each(function() {
    str.push($(this).val());
    });
    oTable.fnReloadAjax("filter_prange.php");
    });
    });


    [/code]
This discussion has been closed.