Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ferry on Jul 31, 2009 13:25
open dhtmlx forum
dhtmlxcombo filteringmode

For using filtering mode, I can use z.enableFilteringMode(true,"loadCombo.php",true,true);
The combo will add the POST headers pos and mask when calling the php file.
But then I have to use as many php scripts as combos I'll have to fill. (different queries needed for each combo)

I tried z.enableFilteringMode(true,"loadCombo.php?select=myselect",true,true);
but that results in loadCombo.php?select=myselect?pos=0?mask=mytext, which doesn't work as suspected.

So, how do I put all my queries in 1 php file and call that file using filteringmode?

Answer posted by Alex (support) on Aug 03, 2009 01:54

Hello, 

which combo version do you use ? 

The issue isn't reproduced with the latest one. 

Answer posted by Ferry on Aug 03, 2009 02:48

For now, I don't know the version, but it should at least be one of the latest.

Maybe it's my mistake and it does work (after trying different coding). I apologize for that.

But, I can't get it to work in combination with the php function render_sql (combo_connector).

I think the funtion doesn't return anyting, but did not have time to investigate it yet.

(I do know my query is ok)

Maybe you can give my an example already.

Answer posted by Alex (support) on Aug 03, 2009 03:06

The example: combo.enableFilteringMode(true,"test.php",true,true);

the test.php:

require_once("../config.php");

$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

require("../../codebase/combo_connector.php");

$combo = new ComboConnector($res);
$combo->enable_log("temp.log");
$combo->dynamic_loading(100);
$combo->render_table("Countries","item_id","item_nm,item_cd");

Answer posted by Ferry on Aug 03, 2009 08:10

I did not use $combo->dynamic_loading(100);
Is it necessary? And t the manual it says it does not require any parameters for combo.

 

I don't understand $combo->render_table("Countries","item_id","item_nm,item_cd"); since i use render_sql to fill my combo's.

I did enable the logging this time and it seems there is some text added to my query which makes the query faulty.

My code:

$combo->render_sql("SELECT DISTINCT profielid, CONCAT(achternaam,', ',voornaam) as naam FROM ".$profieltabel." WHERE achternaam LIKE '".$mask."%' ORDER BY achternaam, voornaam ASC LIMIT ".$pos.", 100","profielid","naam");

produces the query:

SELECT  DISTINCT profielid, CONCAT(achternaam,', ',voornaam) as naam  FROM  profielen  WHERE  achternaam LIKE 'cools%'  AND naam LIKE '%cools%' ORDER BY  achternaam, voornaam ASC LIMIT 0, 100

Answer posted by Alex (support) on Aug 04, 2009 01:46

The correct approach in this case is:

$combo->dynamic_loading(100); /*it is necessary to attach limit block to the query automatically*/

$combo->render_sql("  DISTINCT profielid, CONCAT(achternaam,', ',voornaam) as naam FROM profielen","profielid","achternaam(naam)");

But we have found the issue in the combo connector.So, please try to use attached file instead of the original one  

Attachments (1)
Answer posted on Aug 04, 2009 10:48

I don't need a special php file (yet) if it works like you suggested.

I do have to say the "manuals" are not detailed at all.

When you do a bit of more than basic programming, you can't do it without the knowlegdebase.

Or am I stupid and had to take a betterlook at the manual to find you have to do it like you suggested?

But I'm very glad with the assistance everytime is given.

 

Thank you very much.

Answer posted by Alex (support) on Aug 05, 2009 02:20

>> I do have to say the "manuals" are not detailed at all.

Thank you for the remark. We are working on making documentation more informative.