mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX bulkaction finally take care of url variables properly
This commit is contained in:
parent
cb69f71362
commit
cc8aa9e951
@ -57,7 +57,7 @@
|
|||||||
else cacheBuster = '?cacheBuster=' + cacheBuster;
|
else cacheBuster = '?cacheBuster=' + cacheBuster;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url + '/' + cacheBuster,
|
url: url + cacheBuster,
|
||||||
data: data,
|
data: data,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
context: $(this)
|
context: $(this)
|
||||||
|
@ -95,7 +95,29 @@
|
|||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
},
|
},
|
||||||
onunmatch: function(){
|
onunmatch: function(){
|
||||||
},
|
},
|
||||||
|
getActionURL: function(action, url)
|
||||||
|
{
|
||||||
|
var cacheBuster = new Date().getTime();
|
||||||
|
url = url.split('?');
|
||||||
|
|
||||||
|
if ( action )
|
||||||
|
{
|
||||||
|
action = '/' + action;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
action = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( url[1] )
|
||||||
|
{
|
||||||
|
url = url[0] + action + '?' + url[1] + '&' + 'cacheBuster=' + cacheBuster;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
url = url[0] + action + '?' + 'cacheBuster=' + cacheBuster;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
},
|
||||||
onclick: function(e)
|
onclick: function(e)
|
||||||
{
|
{
|
||||||
var $parent = $(this).parents('.bulkManagerOptions'),
|
var $parent = $(this).parents('.bulkManagerOptions'),
|
||||||
@ -104,12 +126,10 @@
|
|||||||
action = $parent.find('select.bulkActionName').val(),
|
action = $parent.find('select.bulkActionName').val(),
|
||||||
config = $btn.data('config'),
|
config = $btn.data('config'),
|
||||||
|
|
||||||
url = $(this).data('url'),
|
url = this.getActionURL(action, $(this).data('url')),
|
||||||
|
|
||||||
ids = $(this).parents('.bulkManagerOptions').find('input.bulkSelectAll:first').getSelectRecordsID(),
|
ids = $(this).parents('.bulkManagerOptions').find('input.bulkSelectAll:first').getSelectRecordsID(),
|
||||||
data = { records: ids },
|
data = { records: ids }
|
||||||
|
|
||||||
cacheBuster = new Date().getTime()
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -128,15 +148,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$btn.addClass('loading');
|
$btn.addClass('loading');
|
||||||
|
|
||||||
if ( config[action]['isAjax'] )
|
if ( config[action]['isAjax'] )
|
||||||
{
|
{
|
||||||
//if ( url.indexOf('?') !== -1 ) cacheBuster = '&cacheBuster=' + cacheBuster;
|
|
||||||
//else cacheBuster = '?cacheBuster=' + cacheBuster;
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url + '/' + action + '?cacheBuster=' + cacheBuster,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
context: $(this)
|
context: $(this)
|
||||||
@ -147,14 +164,7 @@
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var records = 'records[]='+ids.join('&records[]=');
|
var records = 'records[]='+ids.join('&records[]=');
|
||||||
|
url = url + '&' + records;
|
||||||
if ( window.location.search )
|
|
||||||
{
|
|
||||||
url = url + '/' + action + window.location.search + '&' + records + '&cacheBuster=' + cacheBuster;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
url = url + '/' + action + '?' + records + '&cacheBuster=' + cacheBuster;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user