Show custom message

Show custom message

PhilGPhilG Posts: 8Questions: 0Answers: 0
edited April 2013 in General
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.

Replies

  • yogesh1001yogesh1001 Posts: 7Questions: 0Answers: 0
    u can set the max limit . if u have set it to 10 rows as max limit then

    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.
This discussion has been closed.