Support the ongoing development of Laravel.io →
Requests Input Views
Last updated 1 year ago.
0
  1. Store the pagination number in the query string, session or as a user setting of some kind and then use that to define how many results are returned per page

  2. I would do the former as it's slightly more intuitive

  3. Return another set of html with the updated list, or have the JS on the client ask for an updated list if the delete is successful.

Last updated 1 year ago.
0

Provide two parameters to model

1.Starting Item 2.Number of items to show

And in query start from STARTING ITEM and limit to NUMBER OF ITEMS These way is also good when user change number of items to show.For example lets say user is listing 10 items and he is at page 2 (items 11-21), he change number of items to show to 15.So now good thing is that you already know he already seen first 10 items and you will start list from item 11 to 26.These way you wont repeat items he already seen.

Last updated 1 year ago.
0

Keep in mind that if your application is going full-AJAX you may want to look into a Javascript library (e.g. BackboneJS) to help you keep your code clean. You could, for instance, render each row as a separate Backbone View (and tie them to individual Backbone Models, which could interact with your Laravel backend via REST).

You won't need to do this if it's a toy project or small one, though. It has its own learning curve.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

reuf reuf Joined 4 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.