Yii Framework Forum: Pagination And Insert - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Pagination And Insert

#1 User is offline   TinKi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-June 12

Posted Yesterday, 07:51 PM

Facing with glitch of pagination
Let us imagine that we have configured view model and controller of news.
We havent pagination list (1,2,3,4,>,< etc) on page, but we have jquery callback at the end of page, which loads next page with limit of 5 news with DESC order by create_time.
we have 11 news.
in standart way it will add var $page to $_GET and works fine.

BUT!

1) user loads 1-st page he see:
row11
row10
row9
row8
row7

2) admin adds new row12 at news

3) user loads page 2 to the end of page.
Pagination adds limit 5 and offset 5 to sql, and page1 is row{12-8} so he will see:
row11
row10
row9
row8
row7
row7
row6
row5
row4
row3

so the row7 will be shown twice.

As I see the solution is to send last id as offset.
but how to convert last id to real offset?

I will post part of code if you will request it. Its a bit huge with jquery abd a lot of conditions, so ask me what do you what to see
0

#2 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 525
  • Joined: 26-November 10
  • Location:Sialkot, Pakistan

Posted Yesterday, 10:44 PM

Code please
Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users