Autofilter works but Search template does not

QuestionsAutofilter works but Search template does not
Mario Verleene asked 5 years ago

When using this :

$g->select_command = “SELECT KAWRFCID, Node, KAWShort, KAWUitvoerdatum, Metingop, Metingnodig, LOCATE(KAWShort,Oldrfcinfo) as foundkaw,Oldrfcinfo,Element_Adres,Component, NewRFC FROM XXL_KAWRFC_Lijst”;
$g->table = “XXL_KAWRFC_Lijst”;

in combination with this field :

$col = array();
$col[“title”] = “KAWfound”;
$col[“dbname”] = “LOCATE(KAWShort,Oldrfcinfo)”;
$col[“name”] = “foundkaw”;
$col[“width”] = “3”;
$col[“search”] = true;
$col[“align”] = “right”;
$cols[] = $col;

Autofilter works perfectly but when I use the templates with this code it throws an error :

// Define predefined search templates
$grid[“search_options”][“tmplNames”] = array(“Nodige meting”);
$grid[“search_options”][“tmplFilters”] = array(
array(
“groupOp” => “AND”,
“rules” => array (
array(“field”=>”foundkaw”, “op”=>”cn”, “data”=>”0”)
)
)
);

Getting error : Couldn’t execute query. Unknown column ‘LOCATE(KAWShort,Oldrfcinfo)’ in ‘where clause’ – SELECT count(*) as c FROM (SELECT KAWRFCID, Node, KAWShort, KAWUitvoerdatum,Metingop,Metingnodig,LOCATE(KAWShort,Oldrfcinfo) as foundkaw,Oldrfcinfo,Element_Adres,Component, NewRFC FROM XXL_KAWRFC_Lijst WHERE 1=1 AND `LOCATE(KAWShort,Oldrfcinfo)` LIKE ‘%0%’) pg_tmp

When I remove the ` (around the LOCATE(KAWShort,Oldrfcinfo)) from the Query it works.

What is the solution to this problem?

Thanks,

best regards

2 Answers
Abu Ghufran Staff answered 5 years ago

This may need a fix. Will be updating you back after some more testing.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 5 years ago

Looks like you are using older version as i am unable to generate this issue on latest.

Emailing you latest, please check after update.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

9 + 2 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?