Welcome Guest, Not a member yet? Register   Sign In
Pagination Problems
#1
Question 
(This post was last modified: 09-29-2020, 12:56 PM by Gary.)

I have a (reasonably) 'standard' incarnation of the manual pagination working well, however, in an attempt to maximize MySQL's index use, whilst not generating an excessively burdensome load on MySQL to maintain indexes, I have my code pulling a 'general' query out of the database, which is then processed in the CI application (basically removing the (potentially diverse), but few specific unwanted records that have come back in the sizeable general query result).

This works great because I get to maximize the use of the database indexes, which are also kept small and easy for MySQL to maintain, and at the same time can filter on any field and have reasonably complex processing on the returned data before presenting it to the user... in what would seem a pretty much typical implementation of CI interfacing with a database.

This is all good, however, I've now come up against a bit of a headache with the way I've been handling pagination- which relies on all the filtering being done via builder selected queries (with chaining) in a Model and then returning $this.

I currently have the database interaction happening in a Model, and then the specific/detailed filtering (which is directly controlled by selections by the user) happening in a Controller (that, as expected, gets the user selections posted from a View generated by that particular Controller).

Once I have the filtered/processed results done to be paginated, they are now sitting in an array in the Controller... and it's seemingly very difficult/impossible to now get this result into the Pagination functionality.

Do I need to pass all of the user-spec'd parameters down to the Model to have the fine filtering/processing happen there (and would it work if it was there... it would still somehow have to be pushed in a sensible manner into $this to be returned (?))... or is there some other sensible way to get around this (like passing the final results array to a dummy Model (that would come with the standard builder functionality) that can then simply return what it has been past as $this)?... if that makes sense?

And pointers or advice would be greatly appreciated. Thanks.
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