⚠ 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

Separator / Input Group



heruprambadi
  • profile picture
  • Member

Posted 18 May 2015 - 08:36 AM

I find a topic about grocerycrud separator, but the explanation there is not very clear for me.

Can someone explain to me how this work ?


Amit Shah
  • profile picture
  • Member

Posted 22 May 2015 - 02:42 AM

add grocery_crud_with_group.php to your libraries..

 

add the rest to the views (flexigrid is what i worked with)

 

there is an example

$crud->set_group('fryer', 'Fryer & Container Information', array('number_of_fryers', 'type_of_containers', 'size_of_containers'));
$crud->set_group('op_info', 'Oil Pickup Information', array('setup_date', 'comments','pickup_type', 'pickup_start_date', 'frequency', 'manual_pickup_comments'));
$crud->set_group('payment', 'Payment Information', array('rate_of_payment', 'same_as_above', 'payment_address','payment_city', 'payment_state', 'payment_zip', 'payment_payable_to', 'cash_account', 'special_instructions'));
$crud->set_group('others', 'Other Information', array('picture', 'cr_title', 'cr_date', 'cr_signature', 'opc_title'));

u may tweek around the code as u like

 

 

 


heruprambadi
  • profile picture
  • Member

Posted 22 May 2015 - 06:31 AM

add grocery_crud_with_group.php to your libraries..

 

add the rest to the views (flexigrid is what i worked with)

 

there is an example

$crud->set_group('fryer', 'Fryer & Container Information', array('number_of_fryers', 'type_of_containers', 'size_of_containers'));
$crud->set_group('op_info', 'Oil Pickup Information', array('setup_date', 'comments','pickup_type', 'pickup_start_date', 'frequency', 'manual_pickup_comments'));
$crud->set_group('payment', 'Payment Information', array('rate_of_payment', 'same_as_above', 'payment_address','payment_city', 'payment_state', 'payment_zip', 'payment_payable_to', 'cash_account', 'special_instructions'));
$crud->set_group('others', 'Other Information', array('picture', 'cr_title', 'cr_date', 'cr_signature', 'opc_title'));

u may tweek around the code as u like

this is different methode that you created your self, didnt it @amit ?

Ok, i will try it ;)


heruprambadi
  • profile picture
  • Member

Posted 24 May 2015 - 16:36 PM

Amit, could you explain more detail ? i follow your instruction and got this error :

 

 


Amit Shah
  • profile picture
  • Member

Posted 25 May 2015 - 09:24 AM

well u need to create new Grocery_crud_with_group() instead of new Grocery_crud()

 

that way u should be able to fix the same.


heruprambadi
  • profile picture
  • Member

Posted 30 May 2015 - 03:44 AM

Amit, i got this error (attachment).

This is my controller :

public function customers_management()
	{
			$crud = new Grocery_crud_with_group();
			//$crud = new Grocery_crud();

			$crud->set_table('customers');
			$crud->set_theme('flexigrid');
			$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
			$crud->set_subject('Customer');
			$crud->add_fields('customerName','contactLastName');
			$crud->set_group('customerName', 'Fryer & Container Information', array('customerName','contactLastName'));
			$crud->set_relation('salesRepEmployeeNumber','employees','lastName');

			$output = $crud->render();

			$this->_example_output($output);
	}

Amit Shah
  • profile picture
  • Member

Posted 01 June 2015 - 02:41 AM

oops... sorry for that - u just need to remove the mask stuff.... its - i added it for availing the field to have mask

 

or u need to add the following

$this->set_js($this->default_theme_path.'/flexigrid/js/jquery.maskedinput-1.3.1-min.js');  -- add the maskedinput js to the set path

 

in grocery crud ... need to set the following

protected function showAddForm()
    {
        $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY);

        $data                     = $this->get_common_data();
        $data->types             = $this->get_field_types();
        $data->masks            = $this->field_mask;
protected function showEditForm($state_info)
    {
        $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY);

        $data                 = $this->get_common_data();
        $data->types         = $this->get_field_types();
        $data->masks        = $this->field_mask;
class Grocery_CRUD extends grocery_CRUD_States
{
.........
protected $field_mask                            = null;
.........
     /**
     *
     * Sets mask to the given field
     * @param string $field
     * @param string $mask
     */
    public function mask_field($field , $mask)
    {
        $this->field_mask[$field] = $mask;
        return $this;
    }

that will avail u the ability to set the mask to any field

 

Happy GCing.


heruprambadi
  • profile picture
  • Member

Posted 04 June 2015 - 12:57 PM

waaw ! Thank you so much amit, it works. :D

but the view looks like a little mess. Why is that ?


Amit Shah
  • profile picture
  • Member

Posted 05 June 2015 - 11:00 AM

well.. must be something near / dear with the css .. i can share you my css but then it may change the looks / feels with your page.. 

my gc app is gelled in with a theme - i aint an css expert but somehow i managed to make the 2 look dependently well...

 

i will recommend - just get your hands dirty with the css @your local end. Should do well ..

 

Happy GCing :)


heruprambadi
  • profile picture
  • Member

Posted 06 June 2015 - 05:10 AM

if you can, why not you share with me ? Share it please  :rolleyes: