dhtmlxConnector filter in php

I am using dhtmlxConnector for PHP v.1.5 Everything works fine. But next line

$grid->filter("id", "5"); 

gives a php error:

Fatal error: Call to undefined method GridConnector::filter() in my_connector.php on line 10

I got instructions here docs.dhtmlx.com/doku.php?id=dhtm … ods#filter

Thanks.

Please grab the latest version of connector from github

github.com/DHTMLX/connector-php

Perfect. Thanks.

Hi Sematik,

A curiosity ! In this old post why did you suggest to use the connector version in github instead of downloading your last version 1.5.
1.5 version is not the last version ?

Anyway i tried to use github version and the filter method seems to run with grid_connector but not with TreeGridConnector.

I’ve a TreeGrid like this:
Field1 Field2 Field3

  • Level1
    • Level2
      • Level3 1

In this structure i’ve the 3rd level with the Field3 that could be set to 1 (boolean) and i need to filter my treegrid to show only the rows with value 1, of course toghether with there Level1 and Level 2 parents as happens in client-side filtering. The problem is that i can’t use clien-side filter because i’m using dynamic_loading.

I tried this code:

<?php $res=mysql_connect("localhost","root","root"); mysql_select_db("prova"); require("../codebase/connector/treegrid_connector.php"); $tree = new TreeGridConnector($res); $tree->filter("Field3",1); $tree->render_table("treedata","ID","treedescription,Field1,Field2,Field3","","PARENT ID"); ?>

If i use it with grid_connector the filter runs, of course, showing only the lower level without its upper parents.
If i use treegridconnector, no rows are shown.

Can you help me ?

Version at dhtmlx.com is stable, but not the latest one.
Version at github is the latest one with all fixes and new features but may be not so well tested

In most cases, the latest code from github is a better choise.

Hi Stan and thanks for your answer but while you are answering i was modifing my post.

Can you read it again please !

thanks.

Unfortunately, there is no way to achieve the desired result with TreeConnector currently.

In case of dynamic loading TreeConnector will fetch data only for one level of tree at once, so while providing first level of data connector just has not info about value of Field 3 on third level of hierarchy.

OK but isn’t there a way to let treeconnector understand the level ? The information about the parents is included in kidsxmlFile ! and in the render_table sintax are included ID and PARENT ID.

Assumed it only that the field to filter i specified in php script is in first level ?

Anyway in the php script where i set the tree->filter i don’t use dynamic loading while it’s set in the script file used for kidsxmlFile.

Isn’there some way to solve the problem ? i know you are a genius !
Using client-side filtering without dynamic loading is too slow !

Thanks.

There are separate TreeMultitableConnector that allows to define a separate configuration for each level of the table, so you can configure a separate filter instruction for desired level of tree.

docs.dhtmlx.com/connector__php__ … ector.html