Show error message inside datatable

Show error message inside datatable

karibusanakaribusana Posts: 11Questions: 5Answers: 0
edited March 2020 in Free community support

Hi, is it possible to show error message inside datatable? At the moment I've only achieved to show a popup error with plugin sweetalert. I load table with ajax request this is my code:

var dataTable = $('#mytable').on('error.dt', function (e, settings, techNote, message) {

                Swal.fire({
                    title: 'Ops qualcosa è andato storto!',
                    text: "Non riusciamo a trovare i dati nel database, per favore contatta l'amministratore di sistema!",
                    icon: 'error'
                });

                // Rimuovo l'icona del processing
                $("#mytable_processing").css("display", "none");

            }).DataTable({ });

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You could use infoCallback perhaps, or create an element with dom to hold an error message.

    Colin

  • karibusanakaribusana Posts: 11Questions: 5Answers: 0

    Hi @colin thanks for your answer. Is it possible for you to show me how to achieve this? Many thanks

This discussion has been closed.