Jump to content


David Leiva

Member Since 09 Apr 2012
Offline Last Active Apr 01 2013 03:26 PM
-----

Posts I've Made

In Topic: readOnly and invisible

26 October 2012 - 04:38 PM

Read only just make read onlye the field. It still visible.
Invisible, is a little bit weird.  it just really add the field to the form but invisble mode. So, it is there. and you can receive it in a callback for example.
however Hidden is a usefull type, because allows you to set a default value in a idden field.. for example an id.

Remeber: the function change_field_type "The third parameter ($value) only works for the hidden, enum and set field and it is not a default value for all the other types."

hoping help you
David

In Topic: how to load my own $row with $output

26 October 2012 - 04:29 PM

I think you are not using grocery crud properly. Look at the examples how it works.

You should do:


// in your controller
$crud = new grocery_CRUD();
$crud->set_table('island');
$crud->where('island.id_island',$this->uri->segment(3));
$crud->colums('island_name')
$output = $crud->render()

//in your view
echo $output;

In Topic: relation n_n missing when unset field

25 October 2012 - 01:11 PM

New aproach


if (isset( $post_data[$field_name] ) ){
// field is in the post. Update normaly.
$relation_data = $post_data[$field_name];
$this->db_relation_n_n_update($field_info, $relation_data ,$primary_key);
}else{
// field is NOT in the post. maybe due to unset or maybe delete. ?
if( !in_array($field_name,$this->unset_add_fields) && !in_array($field_name,$this->unset_edit_fields) )
{
// field needs to be empty because is not in the unset add or edit arrays.
$relation_data = array();
$this->db_relation_n_n_update($field_info, $relation_data ,$primary_key);
}
// if field is in one of the unset arrays. we keep the relation date. Do nothing.
}

In Topic: relation n_n missing when unset field

25 October 2012 - 12:45 PM

Hello Johnny,

Thanks for your explanation, I am just really begining with your amazing library and I don't understand the core very well yet.

I'll check it again to try to understand .

Thanks again!

Cheerss
David.

In Topic: relation n_n missing when unset field

24 October 2012 - 09:27 AM

Exactly , like you told me.
I fix the problem. I've sent you the pull request.

thanks!