Index: branches/5.1.x/core/units/helpers/col_picker_helper.php =================================================================== diff -u -N -r14241 -r14353 --- branches/5.1.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 14241) +++ branches/5.1.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 14353) @@ -1,6 +1,6 @@ defaultColumnWidth; } $this->SetCRC($cols); } @@ -191,11 +198,12 @@ $fields[$counter] = $name; $titles[$name] = $options['title']; - $widths[$name] = array_key_exists('width', $options) ? $options['width'] : 100; // only once per grid ! - if (isset($options['hidden']) && $options['hidden']) - { + $widths[$name] = isset($options['width']) ? $options['width'] : $this->defaultColumnWidth; // only once per grid ! + + if (isset($options['hidden']) && $options['hidden']) { $hidden[$counter] = $name; } + $counter++; } $sorted_fields = $fields; @@ -257,13 +265,22 @@ function SaveWidths($prefix, $widths) { - if (!is_array($widths)) $widths = explode(':', $widths); - array_shift($widths); // removing first col (checkbox col) width + if (!is_array($widths)) { + $widths = explode(':', $widths); + } + $i = 0; + array_shift($widths); // removing first col (checkbox col) width + foreach ($this->PickerData['order'] as $ord => $field) { - if ($field == '__FREEZER__') continue; - $this->PickerData['widths'][$field] = $widths[$i++]; + if ($field == '__FREEZER__') { + continue; + } + + $this->PickerData['widths'][$field] = isset($widths[$i]) ? $widths[$i] : $this->defaultColumnWidth; + $i++; } + $this->StoreCols($prefix, $this->PickerData); }