MASTER I add functinality label an addRoww to focus

I add functinality label an addRoww to focus
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-10-16 11:19:42 -04:00
parent 06966ad548
commit 19dd7e5efb
2 changed files with 24 additions and 1 deletions

View File

@@ -685,6 +685,14 @@ var G_Grid = function(oForm, sGridName){
if (this.onaddrow) {
this.onaddrow(currentRow);
}
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

@@ -4781,7 +4781,9 @@ class xmlformTemplate extends Smarty
function getFields(&$form, $therow = -1)
{
$result = array ();
foreach ( $form->fields as $k => $v ) {
if ($form->mode != '') { #@ last modification: erik
$v->mode = $form->mode; #@
} #@
@@ -4789,7 +4791,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') {