hello guys - my question is actually on set_relation, when i choose from the drop down it storing the id of the field instead of the actual text.is there a way to get the text instead of the id. thanks a lot.
im stuck with callback_after_insert - need help
- Single Page
Posted 06 September 2015 - 09:25 AM
Posted 07 September 2015 - 13:18 PM
well.. u can then not choose to use set relation.. rather u can set field type to be enum with having the set of texts as values
http://www.grocerycrud.com/documentation/options_functions/field_type#enum-field - this will help u understand as how it gets done..
this way u will have a drop down without having the ID.
If you still need to have text along with ID .. then u can just directly have an additional field which is going to store text value.. set that field to be hidden .. and add callback after insert / update .. there u can select the actual row of relation table and populate the field with respective value..
There are multiple ways to a solution.. its upto you what suites u and what you will choose!!
Happy GCing ..
Posted 08 September 2015 - 01:02 AM
assalamualaikum Amit, thanks for the quick response.
is this possible? $crud->field_type('fruits','set',array( coming from a table??? ));
in the array part data will be coming from a table.
thanks again.
Posted 08 September 2015 - 10:09 AM
well u can extract the data from the table for surre - coding is your creativity and all you coders are awsomely creative.. enjoy the same :)