Пример #1
0
/** 
 *
 *
 **/
$page->nextTab("Editar");
$f = new FormComponent();
for ($i = 0; $i < sizeof($values); $i++) {
    $f->addField($values[$i]["campo"], $values[$i]["caption"], $values[$i]["tipo"], utf8_decode($values[$i]["val"]));
}
$f->setEditable(true);
$f->setStyle("big");
$f->addApiCall("api/documento/editar", "POST");
$f->beforeSend("attachExtraParams");
$html = " <script>\n\t\t\tfunction attachExtraParams( a ) {\n\t\t\t\ta.id_documento = " . $documento->getIdDocumento() . ";\n\t\t\t\ta.extra_params = Ext.JSON.encode({ ";
for ($i = 0; $i < sizeof($values); $i++) {
    $html .= $values[$i]["campo"] . " : Ext.get(\"" . $f->getGuiComponentId() . $values[$i]["campo"] . "\" ).getValue() , ";
}
$html .= "});\n\t\t\t\treturn a;\n\t\t\t}\n\t\t</script>";
$page->addComponent($html);
$page->addComponent($f);
/** 
 *
 *
 **/
$page->nextTab("Compartir");
/** 
 *
 *
 **/
$page->nextTab("VistaPrevia");
$DescargaExcel = "<input type='button'  class='POS Boton' onclick=\"location.href='../api/formas/excel/generar2?id_documento=" . $_GET["d"] . "'\" value='Descargar como excel'></input>";