Change the field width in edit/add form
- Single Page
Posted 13 March 2012 - 12:02 PM
Can I change the default field width in edit/add form? For exemple in an integer or text field.
Thanks.
Posted 13 March 2012 - 13:18 PM
change_field_type
Here it is the list of available field type:[list]
[*]integer
[*]true_false
[*]string
[*]text
[*]date
[*]datetime
[*]enum
[*]hidden
[*]invisible
[*]password
[/list]
It's well documented http://www.grocerycr...ange_field_type
Use callback to change the width http://www.grocerycrud.com/examples/callback_before_insert_example
Posted 14 March 2012 - 08:39 AM
It's working:
$crud->change_field_type('aforament', 'integer');
$crud->callback_edit_field('aforament',array($this,'edit_aforament_callback'));
And I change the style in the callback, now it's the same with than the select boxes:
function edit_aforament_callback($value, $primary_key)
{
return '<input type="text" value="'.$value.'" name="aforament" class="numeric" maxlength="9" style="width:238px">';
}