Browse files

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
  • Loading branch information...
1 parent 83267cd commit ba281cf4347ce2faebe483eededa16f14659e728 @chillu chillu committed Nov 21, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 javascript/TableListField.js
View
5 javascript/TableListField.js
@@ -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)
}
);

0 comments on commit ba281cf

Please sign in to comment.