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.
- grocery CRUD website →
- grocery CRUD forum
- → Viewing Profile: Posts: fractorr
Community Stats
- Group Members
- Active Posts 10
- Profile Views 4,362
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
Contact Information
User Tools
Friends
fractorr hasn't added any friends yet.
Latest Visitors
No latest visitors to show
Posts I've Made
In Topic: change view of data for relationship_n_n field on view page.
14 April 2016 - 06:29 PM
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.
- grocery CRUD forum
- → Viewing Profile: Posts: fractorr
- Privacy Policy