Force a limit

QuestionsForce a limit
Sam asked 8 years ago

Is there a way to force a limit so no more than say 5000 rows can be pulled out for any function? Whether it be export, search by date range etc.

3 Answers
Abu Ghufran answered 8 years ago

Hello,

You can connect on_data_display event and truncate the $data array to 5000 if it is greater.
e.g.

$e["on_data_display"] = array("filter_display", null, true);
$grid->set_events($e);

function filter_display($data)
{
if (count($data["params"]) > 5000)
$data["params"] = array_slice($data["params"],0,5000);
}

Refer docs > event handling for help.

Sam answered 8 years ago

I was thinking more of a LIMIT X on all SQL queries.

Abu Ghufran answered 8 years ago

The 'limit x' and offset is dynamcally set based on row numbers of grid and the current page. It will be difficult to override otherwise it will disturb the paging function.

Your Answer

10 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?