ajax - dashboard timeline -


I am trying to implement a dashboard similar to Facebook in the kppp (I am receiving posts and timeline them Posted on and when you see more retrieve the post from this previous offset), but still is confused about the logic and the tool, I should use the cakepig pageging class in my implementation.

  $ this - & gt; Pagination ();   

It should in some way be called through Ajax on some functionality

Where is any help or suggestion starting from?

Thanks

Do not use paget

if You have some things that you are prepaid for data - you are going to overlap the page that you call for page 2 - and as far as the current user is concerned, finally, go to the previous page .

Use timestamp

To use an endless stream of data, such as a query:

  SELECT * Foos WHERE was created & gt; = $ PreviousLastTimestamp ORDER created by DESC LIMIT 20   

Note that when I am using in this example - this can be any such area Which is pseudo-unique.

When you first present the page, store the timestamp of the final entry in a javascript variable, then you should have the "get more posts" argument:

  • Make an AJAX request, from which the last timestamp
  • do the above SQL query (as a $ this-> Foo-> Search call) < / Li>
  • Update the final timestamp in your JS so that you know the next time the user If the person clicks "Receives more posts", then where do you live

    & gt; = The reason for using the condition is that, unless the fields you are testing against, they have unique values, it is possible for many rows with the value being examined. If you have a naturally unique field that you are sorting by (id) then you do not need to use as much or equal as possible, you can use as many as possible and think about duplicate rows. The requirement can be avoided.

    It's been told here that it has been more detailed in this way why you should handle systems such as avoiding making a mark on a traditional page.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -