When you write a program recently, the page uses DataTables to appear with this error message as shown:
It was very strange at the time, because the column values set in the DataTables are as long as the fields of the database query statement, why do you still report such errors? Through IE debugging tools, found that because there is a null value in the record, the database query out of the following records:
2011-05-18 18:31:13,750 Org.apache.ibatis.logging.slf4j.Slf4jImpl:
row:1000100011, 10001fxsp_name_11, <==, NULL, 22.94, 1.8216482164821648
There are only 5 data available from JSON to the foreground page, as shown in figure:
Datatables.js 2603 Line source code in:
/* Sanity Check the length of the new array * *
Modify by Ruiming.lu
if (adatasupplied.length!= oSettings.aoColumns.length &&
if (Adatasupplied.length > OSettings.aoColumns.length &&
Osettings.idrawerror!= Osettings.idraw)
{
_fnlog (osettings, 0, "Added data" (Size "+adatasupplied.length+") does not match known "+
"Number of columns (" +osettings.aocolumns.length+ ")");
Osettings.idrawerror = Osettings.idraw;
return-1;
}
There is such a statement to judge, so this error is thrown.
Therefore, in the use of the process to pay attention to the processing of null values.