HELP ! gridConnector custom filters not working

Hy there all,
I have the following code:

$grid = new GridConnector($res);

$grid->set_options(“chiuso”, array(“OK” => “OK”, “CH” => “CH”));
$grid->set_options(“errQta”, array(“QT” => “QT”));
$grid->set_options(“errScan”, array(“MI” => “MI”, “DC” => “DC”));


(All these columns appear in the sql query)

The combo boxes appear above the grid, properly populated, but if i try to apply any of the filters, the grid refreshes, but with none of the selected filters!

I tried logging the php connector, and each time I see the query sql, with “done in 0,132s”
BUT at the end of the logged sql there is no "WHERE chiuso = ‘OK’ or something similar

Anyone got any ideas?

PLEASE dont make me create 10 different views …!

ps the full sql statement is very complicated:

SELECT q.ordId
,  concat(s.prv,'-',o.NUMERO,'/',o.ANNO,'-',o.NOMINATIVO) ordine
, chiuso
,  MAX(errQta) errQta
,  MAX(errScan) errScan
	SELECT ordId, MAX(err) errQta, '' errScan
		SELECT ordId
		,      tip
		,      '' errQta
		,      IF (SUM(IFNULL(ordQta,0)) = SUM(IFNULL(scanQta,0)),'','QT') err
		FROM (
			SELECT d.ordId
			,      tip 
			,      SUM(qta) ordQta
			,      0        scanQta
			FROM orddet d
			JOIN ordini o ON o.ordId = d.ordId
			JOIN anag_art ON COD_ART = d.articolo
			WHERE chiuso = 'OK'
			GROUP BY ordId, tip
			SELECT f.ordId
			,      tipo tip
			,      0 ordQta
			,      COUNT(*) scanQta
			FROM tagFix100 f
			JOIN tagAna a ON a.tagId = f.tagId
			GROUP BY ordId, tip
		) z
		GROUP BY ordId, tip
		ORDER BY ordId, tip
	) y GROUP BY ordId
	SELECT ordId, '' errQta, max(err) errScan
		SELECT ordId, tipo, COUNT(*) qta, MAX(err) err
		FROM (
			 SELECT tagId, z.tipo , z.ordId, DATE(lastSeen) lastSeen, lastOp
			,      DATA_SCADDEF
			,      CASE chiuso
						  WHEN 'OK' THEN IF(lastSeen < lastOp,'MI','')             
						  WHEN 'CH' THEN IF(lastSeen > DATA_SCADDEF,'DC','')
						  ELSE ''              
				   END err
			FROM (
				SELECT p.tagId, ordId
				,     (SELECT MAX(dttmCAP) FROM tagscans WHERE tagId = p.tagId) lastSeen
				,     tipo
				,     (SELECT MAX(opDT) FROM operazHist WHERE ordId = p.ordId AND opDT < DATE_SUB(DATE(NOW()), INTERVAL 2 DAY)) lastOp
				FROM tagfix100 p
				JOIN tagAna a ON a.tagId = p.tagId
				WHERE p.ordId > 0
				ORDER BY ordId, tipo    
			) z
			JOIN ordini o ON o.ordId = z.ordId
		) a  GROUP BY ordId, tipo
	) z GROUP BY ordId
) q  
join ordini o on(o.ordID = q.ordId)
join sedi   s on(s.sedeId = o.COD_FILIALE) 
WHERE o.cod_filiale = 1
AND (errQta!='' OR errScan!='')


It seems that you do not use dynamic loading. So, there is no need to define filtering via connector. You can define filtering using Grid API. Please take a look at the samples:

And here docs about grid filtering: