How do I show Primary Key in my table.
- Single Page
Posted 02 November 2012 - 00:32 AM
Now.. I've been searching for it and I can't find the solution, I searched and searched and couldn't find any 'problem' like mine.
The table is fine, showing all the data I want even with set_relation, working like a charm. What I want is just show the primary key in my table, so I could do a search by the ID(PK) or anything else.
I need it in my tables, because sometimes I just need the ID(PK) in order to make a fast search and edition.
Can someone help me? What do I need to do, what do I have to change...
Thanks in advance!
Posted 02 November 2012 - 06:01 AM
You can use the callback function "columns".
$crud->columns('[color=#ff0000]id[/color]','name', and other fields);
Posted 02 November 2012 - 17:17 PM
Posted 23 October 2014 - 04:29 AM
go to: application\libraries\Grocery_CRUD.php
find: $this->columns = array();
it is in function: get_columns()
add below line : $this->columns[] = $this->get_primary_key();
Posted 06 February 2017 - 03:14 AM
go to: application\libraries\Grocery_CRUD.php
find: $this->columns = array();
it is in function: get_columns()
add below line : $this->columns[] = $this->get_primary_key();
Any one please! how to do to work search function for primary_key ? :(
Posted 06 February 2017 - 03:17 AM
I show primary key with $crud->columns('id','name', and other fields); and then i see id field in list. but search function is not work for id field. how do i need to do to search primary key(id)