codeigniterplus icon indicating copy to clipboard operation
codeigniterplus copied to clipboard

Pagination doesn't work

Open Jeferex opened this issue 10 years ago • 3 comments

The pagination doesn't work. In messages, I inserted 15 rows. When I go to page number 1, everithing is OK but page number 2 shows me messages with Id > 2 and it should show messages with id > 10.

Please check it out.

Jeferex avatar Apr 29 '15 15:04 Jeferex

Seems like its the setting for paginationlib.php inside 'application/libraries/app' directory. Please check the settings for "$config['uri_segment']" to the proper uri segment number based on the uri structure for your application. Let me know if it still doesn't work.

ranacseruet avatar May 08 '15 05:05 ranacseruet

I haven't changed anything. The $config['uri_segment'] is 4 as in your code. Can you try adding 15 messages in message table to check? I think the cause is $start_record = 0 and get_by_range method in My_DModel. When I go to page 2, $start_record = 2 and findBy would start at record 2 and it should start at record 11.

Jeferex avatar May 08 '15 16:05 Jeferex

Please check Pull Request https://github.com/ranacseruet/codeigniterplus/pull/26

I fixed the bug.

Jeferex avatar May 15 '15 17:05 Jeferex