Jump to content


edgarvaldes's Content

There have been 4 items by edgarvaldes (Search limited from 19-January 20)


By content type

See this member's

Sort by                Order  

#11536 How can I show the total number of results/rows

Posted by edgarvaldes on 04 September 2014 - 06:13 PM in I have a question

Hi, Amit

 

Grocery crud already shows you how many items it are actually available for the given criteria

 

Can you elaborate, please? I can't find anyting in the documentation. :unsure:




#11520 How can I show the total number of results/rows

Posted by edgarvaldes on 03 September 2014 - 05:02 PM in I have a question

I use

 

$this->grocery_crud->where('field IS NOT NULL');

 

So,  I just want to add something like this at the top of the page:

 

"We have X records with that criteria"

 

using an existing method of CodeIgniter or GroceryCrud, instead of using a manual php code to count the rows.

 

Thanks in advance.




#11433 How to use callback_column functions from a helper file?

Posted by edgarvaldes on 31 July 2014 - 06:23 PM in I have a question

CodeIgniter lets you organize all your functions inside helpers files. This is great, because I reuse the same functions in some controllers and I have to copy/paste all of them from one to another, so the idea of using a single file is a lot better.

 

So, I need to put all my "callback_column functions" inside a helper file for a better management. But, once this is done, how can I call/use the function in the controller?

 

P.S. I am not that good with Object Oriented Programming, so please be gentle :(




#11160 How set_relation affects unset_column?

Posted by edgarvaldes on 13 May 2014 - 10:08 PM in I have a question

EDIT: Nevermind, it works now. Just a typo in my code :)

 

 

Hi guys

 

 

I'm having a problem with unset_column()

Grocery CRUD 1.3

 

I need to hide certain columns based on roles (using ion_auth), so I have this:

$my_group = array('admin', 'editor', 'colab');
if (!$this->ion_auth->in_group($my_group))
    {
         $crud->unset_columns( 'A', 'B', 'C', 'D'); 
    }

'A', 'B', and 'C' are unset without problems, but column 'D' is still showing.

The column D data is retrieved with "set_relation" from 2 tables.

 

Why? How set_relation affects unset column?