Esempio n. 1
0
}
PhpExt_Javascript::sendContentType();
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$field_width = 180;
//ancho de los controles
$grid_id = '';
if (isset($_POST['gid'])) {
    $grid_id = $_POST['gid'];
}
//creacion de controles
$txt_nombre = PhpExt_Form_TextField::createTextField("txt_nombre", "Nombre")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$txt_descripcion = PhpExt_Form_TextArea::createTextArea("txt_descripcion", "Descripción")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$chk_anonimo = PhpExt_Form_Checkbox::createCheckbox("chk_anonimo", "Anónimo")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$chk_confiados = PhpExt_Form_Checkbox::createCheckbox("chk_confiados", "Confiado")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
//Boton grabar OnClick
$handler_grabar = " \nfunction(){\nthis.findParentByType('form').getForm().submit(\n\t{    \t       \n\t\t\t\t\t\t reset : true,\n\t\t\t\t\t   waitMsg : 'Enviando Datos',\n\t\t\t\t\t waitTitle : 'Emporika',\t\t\t\t   \n\t\t\t   grid_reload_id  : '{$grid_id}',\n\t\t\t\t   new_tab_dir : '/seguridad/role/update',\n\t\t\t\t new_tab_title : 'Modificar Rol',\n  new_tab_pass_response_params : { id : 'id'},  \n\t\t\t\t load_tab_here : true\t   \n\t}\n\t\n\t);\t\t\t\t\n\t\n}";
$btn_grabar = PhpExt_Button::createTextButton("Grabar", new PhpExt_JavascriptStm($handler_grabar));
//Data_Reader para leer los resultados devueltos
$error_reader = new PhpExt_Data_JsonReader();
$error_reader->setRoot("errors");
$error_reader->setSuccessProperty("success");
$error_reader->addField(new PhpExt_Data_FieldConfigObject("id"));
$error_reader->addField(new PhpExt_Data_FieldConfigObject("msg"));
//formulario que contiene todos los controles
$frm_nuevo_rol = new PhpExt_Form_FormPanel();
$frm_nuevo_rol->setErrorReader($error_reader)->setUrl("/seguridad/role/new_process")->setFrame(true)->setWidth(350)->setAutoHeight(true)->setTitle("Datos del Rol")->setMethod(PhpExt_Form_FormPanel::METHOD_POST);
//marco para poner los controles
$marco = new PhpExt_Form_FieldSet();
$marco->setDefaults(new PhpExt_Config_ConfigObject(array("width" => 210)))->setAutoHeight(true);
Esempio n. 2
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.form.Radio", "radio");
 }
Esempio n. 3
0
 /**
  * Helper function to create a Checkbox.  Useful for quick adding it to a ComponentCollection
  *
  * @param string $name The field's HTML name attribute.
  * @param string $label The label text to display next to this field (defaults to '')
  * @param string $id The unique id of this component (defaults to an auto-assigned id).
  * @param string $inputValue The value when the field is checked
  * @return PhpExt_Form_Checkbox
  */
 public static function createCheckbox($name, $label = null, $id = null, $inputValue = null)
 {
     $c = new PhpExt_Form_Checkbox();
     $c->setName($name);
     if ($label !== null) {
         $c->setFieldLabel($label);
     }
     if ($id !== null) {
         $c->setId($id);
     }
     if ($inputValue !== null) {
         $c->setInputValue($inputValue);
     }
     return $c;
 }