⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

Please, help me see where I'm wrong


  • Please log in to reply
No replies to this topic

#1 matiasnabarro@gmail.com



  • Members
  • Pip
  • 5 posts

Posted 07 March 2019 - 12:51 PM

	public function mate_detalle($id)

		//echo $id;

		$crud = new grocery_CRUD();



		$crud->fields(["tbl_opes_id","tbl_materiales_id", "cantidad", "tbl_unidades_id"]);
        // Show in

		$crud->add_fields(["tbl_materiales_id", "cantidad", "tbl_unidades_id","tbl_opes_id"]);
		$crud->edit_fields(["tbl_materiales_id", "cantidad", "tbl_unidades_id","tbl_opes_id"]);
		$crud->columns(["tbl_materiales_id", "cantidad", "tbl_unidades_id"]);
        // Fields type
		$crud->field_type("tbl_opes_id", "hidden");
        $crud->field_type("id", "integer");
		$crud->set_relation("tbl_opes_id", "tbl_opes","parte_serv");
		$crud->set_relation("tbl_materiales_id", "tbl_materiales", '{material_codigo} - {material_nombre}');
		$crud->field_type("cantidad", "integer");
		$crud->set_relation("tbl_unidades_id", "tbl_unidades", '{unidad_abrev} ({unidad})');

		// Relation n-n

		// Display As
		$crud->display_as("tbl_opes_id", "Operaci&oacuten");
		$crud->display_as("tbl_materiales_id", "Material");
		$crud->display_as("cantidad", "Cantidad");
		$crud->display_as("tbl_unidades_id", "Unidad");

		// Unset action

		$output = $crud->render();

    $this->load->view('/template/header', $output);


	function set_ope_id_callback($post_array)
        $post_array['tbl_opes_id'] =$this->id_operacion;
 		return $post_array;

I can't see where is the error. I need to hide "tbl_opes_id" in edit and add views but I can't do it. If I take off the field in "add_fields" or "edit_fields", the data is not inserted and shows me an error. $crud->field_type("tbl_opes_id", "hidden") doesn't works in the way I use it.  Thanks in advance!. PS: I'm using bootstrap-V4 theme with 1.6.2 version of GC

Also tagged with one or more of these keywords: hidden

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users