Show custom message
Show custom message
I have a situation where I would like to display an error message in Datatables telling the user that they've retrieved too many records. This would be similar to the "No data available in table" message, except that it would be displayed when there are far too many records available for display.
The reason I would like this is to prevent users from specifying queries that retrieve too many rows. While the jQuery datatables supports paging and won't have issues displaying this data, my database might fall over :) This is what I'm trying to prevent.
I'm aware of sZeroRecords and sEmptyTable, and I think I'm going to need to add a new class of message. I'm not bothered about localization as we're working in 1 language at the moment.
Any help or pointers in the right direction will be much appreciated.
The reason I would like this is to prevent users from specifying queries that retrieve too many rows. While the jQuery datatables supports paging and won't have issues displaying this data, my database might fall over :) This is what I'm trying to prevent.
I'm aware of sZeroRecords and sEmptyTable, and I think I'm going to need to add a new class of message. I'm not bothered about localization as we're working in 1 language at the moment.
Any help or pointers in the right direction will be much appreciated.
This discussion has been closed.
Replies
oTable=$("#dataTable").dataTable({
----
--
oLang : msg
})
rowCount=oTable.fnGetData.length;
if(rowCount > 10)
{
msg="u have retreived too many records";
}
oTable.fnDraw();
I hope it will work.