Download the PHP package eltharin/reloadablefield without Composer
On this page you can find all versions of the php package eltharin/reloadablefield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package reloadablefield
Symfony ReloadableFields Bundle
Installation
- Require the bundle with composer:
What is ReloadableFields Bundle?
This bundle will help you to work with reloadbale fields, it will make the ajax query and the backend for reload a form select.
The select will have a new event "reload" witch call an ajax query.
When you modify in other page the data linked to the field you can easiest reload them.
This library use junior.js, my small library for manage events, http request and other.
you can download it like this :
You nedd to have the JuniorJs suite for use this bundle :
Or you can use your own script by settings this configuration :
if you want to use default JS for ajax query, leave useOwnJsFile parameters at false and import eltharin/twigfilesgetter for load unique Js : https://github.com/eltharin/TwigFilesGetter
by default, it adds a markup in params/after, you need to update your form theme to view it by add :
ReloadButton HTML
By default, the HTML of the ReloadButton use fontAwesome :
For change the ReloadButton HTML for all of your site, you can create a form template with a block named reloadablefield_reload_button :
or for change only once, in Type Class :
Don't forget to add reload_button class for use default js.
Bonus
How add a "add" button for launch a form popup and reload automaticly the select :
1- in Type Class : add params :
2- with my other JS bundle : https://github.com/eltharin/juniorjs you can have the openpopup class, form will be called in ajax and print in a popup
3- by default automaticly, it add an event "onFormSubmitSuccess" executed after form submit per example: