BUG 9508 I add the option the show scroll

I add propety in form to the grids with scroll
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-10-03 11:57:16 -04:00
parent 8c3a42812c
commit ae11d5c106
5 changed files with 44 additions and 5 deletions

View File

@@ -3295,8 +3295,34 @@ class XmlForm_Field_Grid extends XmlForm_Field
$fieldsSize += $size;
$emptyRow [$key] = array ($emptyValue);
}
if($fieldsSize>100)
$owner->width = '100%';
if (isset($owner->adjustgridswith) && $owner->adjustgridswith == '1') {
// 400w -> 34s to Firefox
// 400w -> 43s to Chrome
$baseWidth = 400;
$minusWidth = 30;
if (eregi('chrome', $_SERVER['HTTP_USER_AGENT'])) {
$baseSize = 43;
} else {
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
$minusWidth = 20;
}
$baseSize = 34;
}
$baseWidth = 400;
$formWidth = (int)$owner->width;
$maxSize = (($formWidth*$baseSize) / $baseWidth);
if ($fieldsSize > $maxSize) {
$this->scrollStyle = 'height:100%; overflow-x: scroll; width:';
$this->scrollStyle .= $formWidth - $minusWidth . ';';
}
} else {
if($fieldsSize>100)
$owner->width = '100%';
}
// else
// $owner->width = $fieldsSize . 'em';
return $this->renderGrid ( $emptyRow, $owner );