summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-11-03 13:22:08 +0000
committerxue <>2006-11-03 13:22:08 +0000
commitd8556e05806edf2ae978921ae97fabc916e49df6 (patch)
tree059f6f19d25a1070200068c70001a416c5406a82
parenta9951e6a822996057e5b05a873ea468045f37728 (diff)
TTableCell should render &nbsp; when no text is set and there is no child control.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php5
-rw-r--r--framework/Web/UI/WebControls/TTableCell.php6
3 files changed, 7 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 754b1626..7c233ce4 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,6 @@
Version 3.0.6 December 4, 2006
==============================
+BUG: TTableCell should render &nbsp; only when Text is not set and there's no child (Qiang)
CHG: constructUrl() now encodes & into &amp; by default (Qiang)
CHG: TRepeater does not render <span> anymore for empty item template (Qiang)
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index 30349244..f0d088d2 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -346,9 +346,8 @@ abstract class TDataGridColumn extends TApplicationComponent
}
break;
case TDataGrid::IT_FOOTER:
- if(($text=$this->getFooterText())==='')
- $text='&nbsp;';
- $cell->setText($text);
+ if(($text=$this->getFooterText())!=='')
+ $cell->setText($text);
break;
}
}
diff --git a/framework/Web/UI/WebControls/TTableCell.php b/framework/Web/UI/WebControls/TTableCell.php
index 8b80e1f2..dad2e69b 100644
--- a/framework/Web/UI/WebControls/TTableCell.php
+++ b/framework/Web/UI/WebControls/TTableCell.php
@@ -185,10 +185,12 @@ class TTableCell extends TWebControl
*/
public function renderContents($writer)
{
- if(($text=$this->getText())==='')
+ if(($text=$this->getText())!=='')
+ $writer->write($text);
+ else if($this->getHasControls())
parent::renderContents($writer);
else
- $writer->write($text);
+ $writer->write('&nbsp;');
}
}