⚠ 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 forum is read-only and soon will be archived. ⚠


fractorr

Member Since 22 Mar 2016
Offline Last Active Apr 22 2016 07:42 PM
-----

Posts I've Made

In Topic: change view of data for relationship_n_n field on view page.

14 April 2016 - 06:29 PM

I was able to figure out a way to do this but modified the core Grocery_crud_model.php file, I added a new field to the table structure called value on store the record value in it. I should probably extend the class instead of keeping the modified core file but at least it works and good for now.  I also modified the read.php theme template to show the value of the new field I added.


In Topic: Replace relation_n_n select boxes

13 April 2016 - 08:17 PM

I created my own JavaScript class to replace the one shipped with GC, I can provide this if anyone is interested.  This is for Bootstrap and I have not tested it outside of Bootstrap.

 

 


In Topic: searching tinyint field (true_false)

29 March 2016 - 11:44 PM

So I just read up on extending GC, pretty cool.  I created this model and it used the set_model function and it seems to work just fine now and now I am not modifying core code. :)

<?php
class Grocery_crud_model_gdbl  extends Grocery_crud_model  {
    function like($field, $match = '', $side = 'both')
    {
    	if ($match == 0) {
		$this->db->where($field, 0);
	} else {
	    	$this->db->like($field, $match, $side);
	}
    }
}

In Topic: searching tinyint field (true_false)

29 March 2016 - 11:24 PM

So this was my fix for this issue, probably not the best way to go about it since it is modifying core code but it seems to work.  I modified the Grocery_crud_model.php file and changed the like function to this.

    function like($field, $match = '', $side = 'both')
    {
    	if ($match == 0) {
		$this->db->where($field, 0);
	} else {
	    	$this->db->like($field, $match, $side);
	}
    }


In Topic: I need 2 types of edit for one table, each type will contain different fields...

29 March 2016 - 04:21 PM

The way I did this was to have a drop down field for record type, then added some JavaScript so that when the field is changed I hide and show fields as needed.  I actually use the gc_with_tabs extension and just hide / show certain tabs instead of hiding / showing a list of fields.