⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠


leffert

Member Since 16 Apr 2017
Offline Last Active Nov 16 2017 08:13 PM
-----

Topics I've Started

Language and number of entries in datatables theme

15 November 2017 - 09:58 PM

1.

I use datatables to get a searcbar on top for some cruds, but the language at top

"Show 102550100 entries"

and bottom

"Showing 1 to 10 of 21 entries"

is not translated to config language, has anybody managed to change these name variables?

 

2.

The datatables theme doesn't seem to register the configs:

$config['grocery_crud_default_per_page'] = 25;

$config['grocery_crud_paging_options'] = array('50','100','500','1000000');

from grocery_crud.php in application/config

How can these be set?


Change order of rows in a crud

14 May 2017 - 02:44 PM

Hi,

I came over this post " http://www.grocerycr...order-of-items/ "

Does this still work or is there an easier way to implement up and down sorting now, its an old post..


Callback issue

16 April 2017 - 09:49 PM

Hi,

I got an issue with the callback functions (delete, update and add), its probably the same problem with them so I show the callback_update as an example. I get the ok message but no update happens in the db.

Can anybody see why this fails? All is working when using autofunctions, the add_action also works.

 

Using with codeigniter and bootstrap.

Im quite novice..

		public function managelibs() {
			$this->grocery_crud->set_table('smartstart_library_name');	
			$this->grocery_crud->set_subject('Bibl');
			$this->grocery_crud->where('smartstart_library_name.school_ID',$this->user->info->ID);
			
			$this->grocery_crud->fields('LID','school_ID','library_name','cols','rows','bckpic');
			$this->grocery_crud->field_type('school_ID','hidden',$this->user->info->ID);
			$this->grocery_crud->change_field_type('LID','invisible');
			
			$this->grocery_crud->columns('library_name','cols','bckpic');
			$this->grocery_crud->display_as('library_name','Name');
			$this->grocery_crud->display_as('cols','Columns');
			$this->grocery_crud->display_as('bckpic','Picture');
			$this->grocery_crud->required_fields('library_name');
			$this->grocery_crud->set_field_upload('bckpic','assets/uploads/files');
			
			$this->grocery_crud->add_action('Links', base_url('assets/links.png'), 'smartstart/showlinks');
			$this->grocery_crud->callback_delete(array($this,'delete_lib'));
		      //$this->grocery_crud->callback_update(array($this,'smartstart/update_lib'));
			$this->grocery_crud->callback_update(array($this,'update_lib'));
			
			$this->grocery_crud->unset_export();
			$this->grocery_crud->unset_print();
			$this->grocery_crud->unset_read();
			
			$output = $this->grocery_crud->render();
 			$this->template->loadContent('smartstart/managelibs.php',array("crud" => $output));
			}


		public function update_lib($post_array, $primary_key) {
			$this->db->where('LID',$primary_key);
		      //$this->db->where('school_ID',$this->user->info->ID);
			return $this->db->update('smartstart_library_name',$post_array);
			}