From b562fcc934fc14625c0cb6b85af9b6a804386fd9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Oct 2008 16:07:01 +0000 Subject: [PATCH] BUGFIX Fixed AssetTableField javascript errors caused by r64049 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64074 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/TableListField.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/javascript/TableListField.js b/javascript/TableListField.js index 47ecf541b..304c41b3e 100755 --- a/javascript/TableListField.js +++ b/javascript/TableListField.js @@ -42,9 +42,8 @@ TableListField.prototype = { var summaryCols = $$('tfoot tr.summary td', this); this._summaryDefs = []; - //if(summaryCols) { - //should check summaryCols.length, cos summaryCols will be alway an array, though its length could be 0. - if(summaryCols.length) { + //should check summaryCols.length, because summaryCols will always be an array, though its length could be 0. + if(summaryCols && summaryCols.length) { rules['#'+this.id+' table.data tbody input'] = { onchange: function(e) { if (!e) e = window.event; // stupid IE @@ -67,11 +66,11 @@ TableListField.prototype = { Behaviour.register('TableListField_'+this.id,rules); - //if(summaryCols) { - //should check summaryCols.length, cos summaryCols will be alway an array, though its length could be 0. + /* if(summaryCols.length) { - //this._getSummaryDefs(summaryCols); + this._getSummaryDefs(summaryCols); } + */ }, /**