Codeigniter-DataTables icon indicating copy to clipboard operation
Codeigniter-DataTables copied to clipboard

Having problem regarding whereClauseArray()

Open takerukimura opened this issue 9 years ago • 1 comments

Hi Zepernick,

Im having problem regarding whereClauseArray() function. What I want to do is using where clause to find event_id = $_GET['id]. So I wrote like this : public function whereClauseArray(){ $conditions = array(); $conditions['event_id ='] = $this->input->get('id'); return $conditions; } But it can't find any data. If I do like this : public function whereClauseArray(){ $conditions = array(); $conditions['event_id ='] = 5; return $conditions; } The data will come out. Is there any specific method to using value from $_GET ?

takerukimura avatar Jun 23 '16 16:06 takerukimura

Hi, As we call that class via ajax so you have to pass url query args with the URL you are calling AJAx

let say posts is your controller and there is a method doajax where your DataTable logic is so you are calling http://someone.com/posts/doajax

in the jquery of your DataTable.

Now the magic is here. you have to pass the $_GET args here like http://someone.com/posts/doajax?id=1

Hope it will help

FayazK avatar Aug 12 '16 20:08 FayazK