sqlFilters only works with one column

Discuss MySQL Ajax Table Editor Paid Version

sqlFilters only works with one column

Postby MrMatt » Tue Mar 29, 2016 4:07 pm

Using the suggested code in the docs and the basic example table I can only get the filter criteria applied in the code with a single column. If more than one is passed, the inline filters and search no longer work.

Code from docs:
Code: Select all
function initiateEditor()
{
     ...
     $this->Editor->setConfig('sqlFilters',"department = 'Engineering'");
}


If I try to do something like this:
Code: Select all
$this->Editor->setConfig('sqlFilters',"department = 'Engineering' OR department = 'Marketing'")

It will load the data matching those departments however the filters and search no longer work. I have also tried using LIKE instead of = but get the same results. Am I missing something?
Thanks.
MrMatt
 
Posts: 22
Joined: Mon Jun 08, 2009 8:33 pm

Re: sqlFilters only works with one column

Postby Atara » Mon Jan 15, 2018 12:59 pm

try to add "(" and ")"
e.g.
Code: Select all
$this->Editor->setConfig('sqlFilters',"((card_id = '" . $cid . "') and (tab_id = '" . $tid . "'))");
Atara
 
Posts: 12
Joined: Wed Jul 26, 2017 9:01 am


Return to Paid Version

Who is online

Users browsing this forum: No registered users and 5 guests

cron