X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/7636dc991c32ffc9990d112acf989ccab9789a90..4160e69ff2d0c2988e030e0b34c30468de47753f:/lib/MECON/HTML/TablaDB.php?ds=inline diff --git a/lib/MECON/HTML/TablaDB.php b/lib/MECON/HTML/TablaDB.php index b518832..fb13bf6 100644 --- a/lib/MECON/HTML/TablaDB.php +++ b/lib/MECON/HTML/TablaDB.php @@ -221,8 +221,12 @@ class MECON_HTML_TablaDB extends MECON_HTML_Tabla { $this->addRowsResult($result, $campos, $obj); } } else { - $id = $this->addRow(array(new MECON_HTML_Error("No se encontraron {$this->_desc}."))); - $this->updateCellAttributes($id, 0, array('colspan' => count($campos))); + $id = $this->addRow(array( + new MECON_HTML_Error("No se encontraron {$this->_desc}."))); + $this->updateCellAttributes($id, 0, + array('colspan' => count($campos) + + count($this->_prependRowsData) + + count($this->_appendRowsData))); } } @@ -315,6 +319,13 @@ class MECON_HTML_TablaDB extends MECON_HTML_Tabla { * // Agrega resultados de la tabla. * $tabla->addRows($result, array('nombre', 'apellido')); * $tabla->display(); + * + * // Funcion callback para darle formato al campo 'activo'. + * // En este caso devuelve 'checked' para indicar que el checkbox está + * // activado si activo es true. + * function checked_callback($activo) { + * return $activo ? 'checked' : ''; + * } * @endcode * * @param mixed $format Si es un string, especifica el formato a usar al