Hi,
Is there a way to add a new link next to any field in the add record section? For example If I have a dropdown list I wish a link near to the field which lead me an other Add record page in a pop-up.
New link at the Add record section
- Single Page
Posted 12 August 2013 - 20:08 PM
Posted 13 August 2013 - 08:11 AM
Well you can add your own .. code of drop down and the add new link besides .. by using callback_field .. this will allow you to add custom code to the field generation. As for grocerycrud by default dose not have this solution
Posted 14 August 2013 - 11:05 AM
Hi!
I have a problem with this solution. The callback_field overwrite everything.
So I have in my Add record panel a crud->set_relation('kodtar_apartman_type_id','kodtar_apartman_type','type'); field. Which one is working well. But when I add the callback function also this field my dropdown disappear and I only have the link. Here is the code.
function torzsadat_apartman_management() { $crud = new grocery_CRUD(); $crud->set_subject('Apartman törzsadat'); $crud->set_table('torzsadat_apartman'); $crud->display_as('szama','Apartman száma'); $crud->display_as('kodtar_apartman_type_id','Apartman tÃpusa'); $crud->display_as('kodtar_ingatlan_type_id','Ingatlan tÃpusa'); $crud->display_as('cim','CÃm'); $crud->display_as('meret','Apartman mérete'); $crud->display_as('ferohely','FérÅ‘helyek száma'); $crud->display_as('kezelo','KezelÅ‘'); $crud->display_as('engedely_kerelem_datum','Engedély kérelem dátuma'); $crud->display_as('engedelyezes_datum','Engedélyezés dátuma'); $crud->display_as('antsz_engedely_datum','ANTSZ engedély dátuma'); $crud->display_as('megjegyzes','Megjegyzés'); $crud->field_type('szama', 'integer'); $crud->field_type('meret', 'integer'); $crud->set_relation('kodtar_apartman_type_id','kodtar_apartman_type','type'); $crud->set_relation('kodtar_ingatlan_type_id','kodtar_ingatlan_type','type'); $crud->set_relation('kezelo','torzsadat_kezelo','nev'); $crud->required_fields('szama','kodtar_apartman_type_id','kodtar_ingatlan_type_id','cim','meret','ferohely'); //Callback_apartman $crud->callback_field('kodtar_apartman_type_id',array($this,'apartman_callback_torzsadat_apartman')); $crud->callback_field('kodtar_ingatlan_type_id',array($this,'ingatlan_callback_torzsadat_apartman')); $crud->callback_field('kezelo',array($this,'kezelo_callback_torzsadat_apartman')); $output = $crud->render(); $this->_main_output($output); } function apartman_callback_torzsadat_apartman() { return anchor('grocery_crud/main/apartman_type_management', '...', 'title="Apartman tÃpus"'); }
How could I re-generate the dropdown inside in the callback?
Posted 14 August 2013 - 21:03 PM
Investigate the dependent dropdown library for regenerating the items of the dropdown.