⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

action callbacks needed



xxaxxo
  • profile picture
  • Member

Posted 03 April 2012 - 05:48 AM

Well , i've posted in a thread - i'd like to preset data for add, but I am using a custom action button from a different table
preseting data in "add" happens with using a callback, but there are no callbacks _before or _after a custom action.

Any ideas what I should do or ?

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 03 April 2012 - 20:22 PM

There is still no callback_before or callback_after action. I want to add a similar functionality for this and it will be a callback_action. I will add it in a future release.

For now perhaps if you change your custom buttons with Javascript it would be a good idea. I don't know if I help you with this,but the callback_action is still a functionality that I don't have :unsure: .

Luan
  • profile picture
  • Member

Posted 06 April 2012 - 01:57 AM

If you cold explain in details what you want to do, i had some issues like that.

My action leads to a small form, there the user chose the category and the city.

You cold use Hidden fields or use some flashdata.


function offices_management_with_actions()
{
$crud->add_action('Photos', '', '','ui-icon-image',array($this,'just_a_test'));
}
function just_a_test($primary_key , $row)
{
$this->session->set_flashdata('name', $info)
return site_url('yourcontroller/offices/add');
}


function offices()
{
$this->session->keep_flashdata('name');
$crud->callback_add_field('services',array($this,'callback_add_services'));
}
function callback_add_services()
{
return "<input type='text' value='".$this->session->flashdata('name')."'";
}