From ba244976861343ac24e03a5c3eab612eda9061fd Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Fri, 12 Dec 2008 16:36:19 +0000 Subject: [PATCH] matrix compare screen bugfix --- lib/WebGUI/Asset/Wobject/Matrix.pm | 7 ++++++- www/extras/wobject/Matrix/matrixCompareList.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 44c50b32a..5f91f39b8 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -1060,7 +1060,12 @@ sub www_getCompareListData { ) }); } foreach my $result (@results){ - unless($result->{fieldType} eq 'category'){ + if($result->{fieldType} eq 'category'){ + foreach my $columnDef (@columnDefs) { + $result->{$columnDef->{key}} = $columnDef->{label}; + } + } + else{ foreach my $listingId (@listingIds) { $result->{attributeId} =~ s/-/_____/g; my $listingId_safe = $listingId; diff --git a/www/extras/wobject/Matrix/matrixCompareList.js b/www/extras/wobject/Matrix/matrixCompareList.js index 4e8a0b99b..4dd36e044 100644 --- a/www/extras/wobject/Matrix/matrixCompareList.js +++ b/www/extras/wobject/Matrix/matrixCompareList.js @@ -22,13 +22,18 @@ YAHOO.util.Event.addListener(window, "load", function() { Dom.setStyle(elCell.parentNode, "background-color", color); } elCell.innerHTML = sData; + }else{ + elCell.innerHTML = sData; } }; this.formatLabel = function(elCell, oRecord, oColumn, sData) { if(oRecord.getData("fieldType") == 'category'){ elCell.innerHTML = "" +sData + ""; }else{ - elCell.innerHTML = sData + "
" + oRecord.getData("description") +"
"; + elCell.innerHTML = sData; + if(oRecord.getData("description")){ + elCell.innerHTML = elCell.innerHTML + "
" + oRecord.getData("description") +"
"; + } } };