BUG 9508 I add the option the show scroll
I add propety in form to the grids with scroll
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user