Welcome Guest, Not a member yet? Register   Sign In
Pagination Problems
#6

(This post was last modified: 09-30-2020, 03:54 PM by Gary.)

Thanks... though this is how I have all of my (long-time already) operational Pagination working, and as mentioned, it works great.

The problem I have is that, to save on a stupid amount of mostly unused indices in the database, I want to do something like this (also the complex calculations would be difficult/impossible to do in a query):

Code:
function myQuery()
{   $sql = "your simple index-based query here";
    $this->db->query($sql);

    // apply user-defined filters that don't rely on an index
    // + custom complex calculations on the query results

    return the filtered/calculated results; // and have Pagination still work
}

Basically, I'd like to be able to have Pagination work with an array of processed data - either from inside a Model (which is where most of the Pagination appears to be embedded), or somehow from inside a Controller.

Update:

I was hopeful when I found the set() method in Model.php (which takes an array as an argument), however, on closer inspection I find it’s only used for 'input' and not for generating results/'output' in methods like paginate().

I see that the HTML Table Class works in a manner close to what I’m looking for, and does accept a user-defined array as an input… however, it doesn’t appear to support pagination.

There is also callback functionality… where one can set up a trigger to do something with the data that has been found…

Code:
$eventData = $this->trigger('afterFind', $eventData);

...though I’ve not come across any documentation detailing its use (to be fair, it’s probably pretty simple to work out without any documentation)... however, in my case, this still looks a bit of pain to implement and if there is a way to somehow get it done from my existing (processed) array, it would be a lot easier.
Reply


Messages In This Thread
Pagination Problems - by Gary - 09-29-2020, 11:36 AM
RE: Pagination Problems - by InsiteFX - 09-29-2020, 03:56 PM
RE: Pagination Problems - by nc03061981 - 09-29-2020, 05:33 PM
RE: Pagination Problems - by InsiteFX - 09-29-2020, 05:36 PM
RE: Pagination Problems - by nc03061981 - 09-29-2020, 05:40 PM
RE: Pagination Problems - by Gary - 09-30-2020, 04:24 AM
RE: Pagination Problems - by nc03061981 - 09-30-2020, 06:13 PM
RE: Pagination Problems - by Gary - 10-01-2020, 04:01 PM
RE: Pagination Problems - by InsiteFX - 10-01-2020, 04:53 PM
RE: Pagination Problems - by nc03061981 - 10-01-2020, 05:40 PM
RE: Pagination Problems - by Gary - 10-02-2020, 02:45 AM
RE: Pagination Problems - by heriniaina - 06-12-2022, 08:44 AM
RE: Pagination Problems - by Gary - 06-23-2022, 09:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB