mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Include GET parameters of current URL in GridField on ajax reloads to retain view state
This commit is contained in:
parent
02e728fa08
commit
b242bfb3da
@ -387,6 +387,9 @@ jQuery.noConflict();
|
||||
*/
|
||||
$('.cms .ss-gridfield').entwine({
|
||||
showDetailView: function(url) {
|
||||
// Include any GET parameters from the current URL, as the view state might depend on it.
|
||||
// For example, a list prefiltered through external search criteria might be passed to GridField.
|
||||
if(window.location.search) url += window.location.search;
|
||||
$('.cms-container').entwine('ss').loadPanel(url);
|
||||
}
|
||||
});
|
||||
|
@ -11,6 +11,12 @@
|
||||
if(!ajaxOpts.data) ajaxOpts.data = [];
|
||||
ajaxOpts.data = ajaxOpts.data.concat(data);
|
||||
|
||||
// Include any GET parameters from the current URL, as the view state might depend on it.
|
||||
// For example, a list prefiltered through external search criteria might be passed to GridField.
|
||||
if(window.location.search) {
|
||||
ajaxOpts.data = window.location.search.replace(/^\?/, '') + '&' + $.param(ajaxOpts.data);
|
||||
}
|
||||
|
||||
form.addClass('loading');
|
||||
|
||||
$.ajax($.extend({}, {
|
||||
|
Loading…
Reference in New Issue
Block a user