Reload datatable when ajax is custom function..?

Reload datatable when ajax is custom function..?

panstepanste Posts: 3Questions: 1Answers: 1

How would you reload this datatable? It has custom function for data retreiving. And tableShapes.api().ajax.reload() doesn't work. Is there any method that will do the work?

tableShapes = $('#tableShapes').dataTable({
                                        "searching": false,
                                        "retrieve": true,
                                        "ajax": function (data, callback, settings) {
                                            promises[1].done(function (response) {
                                                response.data = Object.keys(response.data).map(function (key) {
                                                    return response.data[key]
                                                });
                                                callback(response);
                                            }).fail(function (ex) {
                                                alert("Doslo je do greske.");
                                                console.log(ex);
                                            });
                                        },
                                        "lengthChange": false
                                    });

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    Answer ✓

    ajax.reload() should just trigger your custom function. If it isn't working, I can take a look at a test case if you link to one.

    Allan

  • panstepanste Posts: 3Questions: 1Answers: 1
    edited July 2016

    It just doesn't execute my function... Sorry but how to make a test case?

  • panstepanste Posts: 3Questions: 1Answers: 1
    Answer ✓

    Actualy It trigers my function. The probelm is in caching...
    Thank you, anyway...

This discussion has been closed.