How to disable the warning message?

How to disable the warning message?

rajaaarajaaa Posts: 21Questions: 10Answers: 2

Error: DataTables warning: table id=register - Requested unknown parameter '4' for row 0. For more information about this error, please see http://datatables.net/tn/4

How to disable this warning message by using the jquery.

i have used the coding.

$(document).ready(function() { $.fn.dataTableExt.sErrMode = 'throw'; $('#register').dataTable({ "order": [] }); });

This question has accepted answers - jump to:

Answers

  • rajaaarajaaa Posts: 21Questions: 10Answers: 2
    edited July 2015

    Want to hide the following error from my datatable

    1. Warning: Requested unknown...
  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin
    Answer ✓

    You don't really want to hide the error message. You want to fix what is causing the error. The error message is telling you that something is wrong and needs to be addressed.

    Please link to the page showing the issue if you can't resolve it yourself from the tech note that the error message links so.

    Allan

  • rajaaarajaaa Posts: 21Questions: 10Answers: 2

    s can resolve the error. But in this case i have used colspan which has shows that error because its not supported at present.

    But its working fine. So i thought to hide the warning message.

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    It won't be working fine, since as you say it is not supported. The error message is telling you that. Even if it appears to work, it will give unpredictable results for sorting, filtering, column visibility etc.

    Allan

  • rajaaarajaaa Posts: 21Questions: 10Answers: 2

    But the client need it as colspan and they okk even if its not working properly in sorting, filtering, column visibility they wants it without the warning alert.

    Anyway Thanks allan.

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin
    Answer ✓
    $.fn.dataTable.ext.errMode = 'none';
    

    However, imho this is very bad practice :-)

    Allan

  • rajaaarajaaa Posts: 21Questions: 10Answers: 2

    Thanks allan.

    But its also makes the datatable not too work. And shows the error in the console.

  • rajaaarajaaa Posts: 21Questions: 10Answers: 2
    edited July 2015

    Got worked i have used the datatables 1.10.2 version so it makes an error.

    so i update the plugin. and used the following coding

    $.fn.dataTable.ext.errMode = 'none';

    $('#example').on( 'error.dt', function ( e, settings, techNote, message ) {
    console.log( 'An error has been reported by DataTables: ', message );
    } ) .DataTable();
    $('#example').DataTable();

This discussion has been closed.