add button when no data, and unset add when exist data
- Single Page
Posted 02 April 2012 - 15:28 PM
My question is: can i put the button add when i don't have data in my table, but unset the button add when i have data in my table?
so I used the function unset_add(); to no show the button add, only the eddit option, but if i don't have data in my table i have to show de add buton?
can i do this?
thanks, sorry if i repeat a topic.
Posted 02 April 2012 - 19:23 PM
$crud = new grocery_CRUD();
$table_name = 'your_table';
$crud->set_table($table_name);
if($this->db->from($table_name)->count_all_results() > 0)
$crud->unset_add();
Posted 02 April 2012 - 21:25 PM