FnDraw is not working

FnDraw is not working

spradeeshspradeesh Posts: 7Questions: 2Answers: 0

Hi,

      I have issue on calling fnDraw. Below my code.

dataTable = $('#MeterGrid').dataTable({
"dom": '<"toolbar"><"clear">lfrtip',
"oLanguage": { "sEmptyTable": function () { return "No Data Available"; } },
"aLengthMenu": [
[25, 50, 100, 200],
[25, 50, 100, 200]
],

            "bServerSide": true,
            "sAjaxSource": "/ajax/getdetails",
            "bProcessing": true,
            "bRetrieve": true,
            //"bPaginate": true,
            //"sDom": 'rtlfip',
            "sPaginationType": "full_numbers",
            "columnDefs": [
                {
                    "targets": 5,                        
                    "render": function (data, type, row, meta) {
                        return '<a href="#View_Content" class="ViewBtn" data-id="' + row[0] + '">View</a>';
                    }
                },
                {
                    "targets": 6,
                    "data": "EID",
                    "render": function (data, type, row, meta) {
                        return '<a href="#Edit_Content" class="EditBtn" data-id="' + row[0] + '">Edit</a>';
                    }
                },
            {
                "targets": 7,
                "data": "EID",
                "render": function (data, type, row, meta) {
                    return '<a href="#Delete_Content" class="DeleteBtn" data-id="' + row[0] + '">Delete</a>';
                }
            }
            ]
        });

        $("div.toolbar").html('<a href="#" class="AddBtn">Add Meter</a>');

    });

      After adding / Editing / Deleting, am calling dataTable.fnDraw();, it shows "Processing ...." text forever and nothing happens. Can anyone please help.

Thanks
Pradeesh

Answers

  • spradeeshspradeesh Posts: 7Questions: 2Answers: 0
    edited April 2015

    on fnDraw() , it is calling Server side page and executes fine. only it is not performing in datatable.

  • spradeeshspradeesh Posts: 7Questions: 2Answers: 0

    Issue got fixed, Earlier i was passsing 1 by default to sEcho variable from server side. I changed that to sEcho = param.sEcho. Now it works fine.

This discussion has been closed.