Merge pull request #747 from brayanpereyra/master

I add functinality label an addRoww to focus
This commit is contained in:
julceslauhub
2012-10-16 08:58:41 -07:00
2 changed files with 21 additions and 1 deletions

View File

@@ -685,6 +685,13 @@ var G_Grid = function(oForm, sGridName){
if (this.onaddrow) {
this.onaddrow(currentRow);
}
var newInputs = oNewRow.getElementsByTagName('input');
for (var i = 0; i < newInputs.length; i++) {
if (typeof(newInputs[i]) != 'undefined' && newInputs[i].type != 'hidden') {
newInputs[i].focus();
break;
}
}
};
this.deleteGridRow = function (sRow, bWithoutConfirm)

View File

@@ -4789,7 +4789,20 @@ class xmlformTemplate extends Smarty
$value = (isset ( $form->values [$k] )) ? $form->values [$k] : NULL;
$result [$k] = G::replaceDataField ( $form->fields [$k]->label, $form->values );
if ($form->type == 'xmlform') {
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
if ($v->type == 'checkgroup' || $v->type == 'radiogroup') {
$firstValueOptions = '';
foreach ($v->options as $indexOption => $valueOptions) {
$firstValueOptions = $indexOption;
break;
}
if ($firstValueOptions != '') {
$result[$k] = '<label for="form[' . $k . '][' . $firstValueOptions . ']">' . $result[$k] . '</label>';
} else {
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
}
} else {
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
}
}
if (! is_array ( $value )) {
if ($form->type == 'grid') {