BUG 5648 Fixing restriction to multiple parent dependencie

- This commit change grid dropdown default options ommited
This commit is contained in:
Enrique Ponce De Leon
2011-06-02 11:10:20 -04:00
parent 435e187d5a
commit 90919d4f4b
2 changed files with 23 additions and 11 deletions

View File

@@ -416,6 +416,15 @@ var G_Grid = function(oForm, sGridName){
//aObjects[0].options.add(xOption); //aObjects[0].options.add(xOption);
oNewSelect.options.add(xOption); oNewSelect.options.add(xOption);
} }
}else{
//Copy all options
var oAux = document.createElement(aObjects[0].tagName);
for ( var j = 0; j < aObjects[0].options.length; j++) {
var oOption = document.createElement('OPTION');
oOption.value = aObjects[0].options[j].value;
oOption.text = aObjects[0].options[j].text;
oNewSelect.options.add(oOption);
}
} }
//TODO: Implement Default Value and Dependent Fields Trigger for grid dropdowns //TODO: Implement Default Value and Dependent Fields Trigger for grid dropdowns
} }
@@ -475,6 +484,8 @@ var G_Grid = function(oForm, sGridName){
var exist = false; var exist = false;
for (i=0; i < this.aFields.length; i++){ for (i=0; i < this.aFields.length; i++){
oAux = this.getElementByName(currentRow, this.aFields[i].sFieldName); oAux = this.getElementByName(currentRow, this.aFields[i].sFieldName);
if (typeof oAux !== 'undefined' && oAux != null)
if (typeof oAux.dependentFields !== 'undefined'){
if (oAux.dependentFields.length > 0){ if (oAux.dependentFields.length > 0){
exist = false; exist = false;
for (m=0; m < xIsDependentOf.length; m++) for (m=0; m < xIsDependentOf.length; m++)
@@ -487,6 +498,7 @@ var G_Grid = function(oForm, sGridName){
} }
} }
} }
}
//Fires OnAddRow Event //Fires OnAddRow Event
if (this.onaddrow) { if (this.onaddrow) {
this.onaddrow(currentRow); this.onaddrow(currentRow);

View File

@@ -56,7 +56,7 @@
$G_FORM->id=urlDecode($_POST['form']); $G_FORM->id=urlDecode($_POST['form']);
//$G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array(); //$G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array();
$newValues=($json->decode(urlDecode(stripslashes($_POST['fields'])))); $newValues=($json->decode(urlDecode(stripslashes($_POST['fields']))));
$newValues = array_unique($newValues);
if (isset($_POST['grid'])) { if (isset($_POST['grid'])) {
$_POST['row'] = (int)$_POST['row']; $_POST['row'] = (int)$_POST['row'];
$aAux = array(); $aAux = array();