BUG 10906 Campo Check box no funciona correctamente en version 2.0.46-testing.7 SOLVED

- Cuando el valor de una grilla no contiene los valores de una columna los checboxes no se muertan
- Los datos de una grilla son sanitizados antes de ser enviado al metodo renderGrid
This commit is contained in:
Julio Cesar Laura
2013-02-28 14:59:02 -04:00
parent e45e1d9d8f
commit 1d6c7fc6a5

View File

@@ -5558,6 +5558,24 @@ class xmlformTemplate extends Smarty
}*/
if ($field->type == "grid") {
// Fix data for grids
if (is_array($form->fields[$k]->fields)) {
foreach ($form->fields[$k]->fields as $gridFieldName => $gridField) {
for ($i = 1; $i <= count($value); $i++) {
if (!isset($value[$i][$gridFieldName])) {
switch ($gridField->type) {
case 'checkbox':
$defaultAttribute = 'falseValue';
break;
default:
$defaultAttribute = 'defaultValue';
break;
}
$value[$i][$gridFieldName] = isset($gridField->$defaultAttribute) ? $gridField->$defaultAttribute : '';
}
}
}
}
$result["form"][$k] = $form->fields[$k]->renderGrid( $value, $form, $therow );
} else {
switch ($field->type) {