-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Provide a thin alternative to loadPanel/submitForm. #2352
Conversation
👍 |
This is needed in some situations when we only want to update a small single component, sometimes even using a different controller to the one implied in the URL. An example here is reloading dynamically the subsite dropdown without reloading the entire page, updating a filter sidebar or suchlike.
Really well coded and documented, as usual - thanks Mateusz :) |
API Provide a thin alternative to loadPanel/submitForm.
|
Sorry for being late to the party here but is there a reason for not returning the xhr from the loadFragment() function? |
Yeah we should uses promises more, Mateusz can you send fix+commit that? No need for a PR |
There is no reason, apart from my own ignorance! Thanks @MarcusDalgren Now that I look at it, does it actually make sense to keep the |
I'm not an Entwine buff so I'm not sure in what contexts loadFragment() gets used. However you might want to setup some kind of generic handlers on the Entwine element which gets hit by the loadFragment() and in that case you use afterloadfragment and/or loadfragmenterror depending on your needs. The Entwine afterloadfragment/loadfragmenterror events will capture all loadFragment() calls made on that element while binding directly to the returned promise only affects that specific loadFragment() call. At least that's my understanding of it. |
What I'm trying to say is I'd keep both options just the way it is now. |
Agreed then, leaving both in :-) |
Only to be merged after the silverstripe/silverstripe-framework#2352 is available, and only after Subsites 1.0.0 has been released.
This is needed in some situations when we only want to update a
small single component, sometimes even using a different controller to
the one implied in the URL.
An example here is reloading dynamically the subsite dropdown without
reloading the entire page, updating a filter sidebar or suchlike.