How to Disable Warning DataTables warning Requested unknown parameter from the data source for row

孤街醉人 提交于 2020-01-31 14:43:46

问题


I have two rows within my datatables as follows.

<tr><td></td><td></td><td></td></tr>
<tr><td colspan="3"></td></tr>

These rows repeat themselves for every record on datatables. So as you can imagine, I get this error all the time and just need it disabled unless you want to figure out how to make it work.

So how do you disable the warning: DataTables warning Requested unknown parameter from the data source for row


回答1:


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

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

Above code will solve problem and also log error in console so you can solve the error




回答2:


Just add $.fn.dataTableExt.sErrMode = 'throw' to the page where DataTables will be placed.



来源:https://stackoverflow.com/questions/18007630/how-to-disable-warning-datatables-warning-requested-unknown-parameter-from-the-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!