Search code examples
octobercmsoctobercms-pluginsoctobercms-backendoctober-form-controller

October CMS Repeater pagination or Load More


Hello fellow developers,

I am currently working on a project backed by octoberCMS. Everything seems great except the repeaters.

  1. When the number of the repeater is too much (more than 50) the page hangs up and send an error message of max execution limit exceeded. I don't want to increase the max execution limit but load 10 Repeater at a time with the help of pagination or load more functionality that should be achievable by Ajax.

Has anyone tried this before? or is it even possible to do so? enter image description here

  1. One of my requirement is to popup a form when clicked in a button inside each repeater list item. I'm currently working on it but its taking quite a long time now. the modal should load the update form. Anyone has worked on this sort of situation if yes, any suggestions on how to pop save the form via ajax?

Any answer for my 2 questions would be highly appreciated.


Solution

  • because your requirement is so specific so I think the best solution would be to create your own form widget for that.

    you can see the how octobercms repeater widget is created over here \modules\backend\formwidgets\repeater

    you can copy this widget and paste it into your manually created plugin and then change everything like namespace and widget name etc.. and make it to use the same way as actual repeater works.

    and if you don't know how widget is created then first of all you should learn it from here https://octobercms.com/docs/backend/widgets#form-widgets