mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Oncomplete ajax callbacks for TableListField.js->refresh()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92561 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
83267cdd45
commit
ba281cf434
@ -122,7 +122,7 @@ TableListField.prototype = {
|
||||
this._summarise();
|
||||
},
|
||||
|
||||
refresh: function(e) {
|
||||
refresh: function(e, params, oncomplete) {
|
||||
if(e) {
|
||||
var el = Event.element(e);
|
||||
if(el.nodeName != "a") el = Event.findElement(e,"a");
|
||||
@ -134,12 +134,13 @@ TableListField.prototype = {
|
||||
new Ajax.Request(
|
||||
el.getAttribute('href'),
|
||||
{
|
||||
postBody: 'update=1',
|
||||
postBody: 'update=1' + (params) ? '&' + params : '',
|
||||
onComplete: function(response) {
|
||||
Element.replace(this.id, response.responseText);
|
||||
// reapply behaviour and reattach methods to TF container node
|
||||
// e.g. <div class="TableListField">
|
||||
Behaviour.apply($(this.id), true);
|
||||
if(oncomplete) oncomplete.apply(response);
|
||||
}.bind(this)
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user