BUG 12738 "SQL doesn't work in GRID - Text-Area..." SOLVED
- SQL doesn't work in GRID - Text-Area fields.
- Problema:
Al crear una dependencia entre un Dropdown y Textarea en un grid, al añrlo a un Dynaform y ejecutar el caso,
la dependiencia no funcionaba, al seleccionar una opcion del Dropdown en el textarea no se mostraba ningun valor,
y al adicionar mas filas igual no funcionaba.
Solucion:
El problema es el siguiente: en la clase "class XmlForm_Field_Textarea" en su metodo "renderGrid" no estaba definido
variables de importancia y seteo de las mismas, se completo las variables faltantes.
Otro de los problemas que ocasionaba esta dificultad estaba en el archivo JavaScript en el metodo "updateDepententFields"
se agrego una validacion cuando es un campo de tipo "textarea", esto porque no se podia utilizar el metodo "G_TextArea"
que tambien le faltaba codigo, colocando este codigo faltante tampoco funcionaba.
Al crear una dependencia entre un Dropdown y Textarea en un grid la añrlo a un Dynaform, y ejecutar el caso,
dependiencia funciona correctamente.
Se agrego el siguiente codigo en la clase "class XmlForm_Field_Textarea" en el metodo "renderGrid":
...
$this->executeSQL($owner, $r);
if (isset($this->sqlOption)) {
$firstElement = key($this->sqlOption);
}
if (isset($firstElement)) {
$v = $firstElement;
}
$arrayOptions[$r] = $v;
...
$this->options = $arrayOptions;
...
Disponible para la version 2.5.2
This commit is contained in:
@@ -1982,24 +1982,32 @@ class XmlForm_Field_Textarea extends XmlForm_Field
|
||||
* @param string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid ($values = null, $owner = null)
|
||||
public function renderGrid ($values = array(), $owner = null)
|
||||
{
|
||||
$this->gridFieldType = 'textarea';
|
||||
|
||||
if ($owner->mode != 'view') {
|
||||
$this->renderMode = $this->modeForGrid;
|
||||
}
|
||||
$result = array ();
|
||||
|
||||
$result = array();
|
||||
$arrayOptions = array();
|
||||
|
||||
$r = 1;
|
||||
|
||||
foreach ($values as $v) {
|
||||
$this->executeSQL( $owner, $r );
|
||||
if (isset( $this->sqlOption )) {
|
||||
$firstElement = key( $this->sqlOption );
|
||||
if (isset( $firstElement )) {
|
||||
$v = $firstElement;
|
||||
}
|
||||
$this->executeSQL($owner, $r);
|
||||
|
||||
if (isset($this->sqlOption)) {
|
||||
$firstElement = key($this->sqlOption);
|
||||
}
|
||||
|
||||
if (isset($firstElement)) {
|
||||
$v = $firstElement;
|
||||
}
|
||||
|
||||
$arrayOptions[$r] = $v;
|
||||
|
||||
$scrollStyle = $this->style . "overflow:scroll;overflow-y:scroll;overflow-x:hidden;overflow:-moz-scrollbars-vertical;";
|
||||
$html = '';
|
||||
if ($this->renderMode == 'edit') {
|
||||
@@ -2031,6 +2039,8 @@ class XmlForm_Field_Textarea extends XmlForm_Field
|
||||
$result[] = $html;
|
||||
$r ++;
|
||||
}
|
||||
|
||||
$this->options = $arrayOptions;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user