Stop DataGridView from resizing if the size of the strand is 0x0.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/866d5e44 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/866d5e44 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/866d5e44 Branch: refs/heads/master Commit: 866d5e44f5d5fa4e125af922dd2edcd5ce25f386 Parents: 820ae80 Author: Peter Ent <[email protected]> Authored: Wed Oct 21 15:41:36 2015 -0400 Committer: Peter Ent <[email protected]> Committed: Wed Oct 21 15:41:36 2015 -0400 ---------------------------------------------------------------------- .../src/org/apache/flex/html/beads/DataGridView.as | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/866d5e44/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as index 7f220e9..e06f569 100644 --- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as +++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as @@ -166,15 +166,26 @@ package org.apache.flex.html.beads */ private function handleSizeChanges(event:Event):void { + var useWidth:Number = _listArea.width; + var useHeight:Number = _listArea.height; + + if (host.width > 0) { + useWidth = host.width; + } + _header.x = 0; _header.y = 0; - _header.width = host.width; + _header.width = useWidth; _header.height = 25; + if (host.height > 0) { + useHeight = host.height - _header.height; + } + _listArea.x = 0; _listArea.y = 26; - _listArea.width = host.width; - _listArea.height = host.height - _header.height; + _listArea.width = useWidth; + _listArea.height = useHeight; var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
