summaryrefslogtreecommitdiffstats
path: root/samples/tree/01p_basic_connector.php
diff options
context:
space:
mode:
authorMaksim <max@dhtmlx.com>2011-07-18 18:21:10 +0300
committerMaksim <max@dhtmlx.com>2011-07-18 18:21:10 +0300
commit5c2afae6cf595c981155ac68501ac2d1af77db54 (patch)
treeb07de6379fb3eb540df732a57061cafd05288599 /samples/tree/01p_basic_connector.php
downloadconnector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.zip
connector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.tar.gz
connector-php-5c2afae6cf595c981155ac68501ac2d1af77db54.tar.bz2
* import of php connector v1.2
Diffstat (limited to 'samples/tree/01p_basic_connector.php')
-rw-r--r--samples/tree/01p_basic_connector.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/samples/tree/01p_basic_connector.php b/samples/tree/01p_basic_connector.php
new file mode 100644
index 0000000..23739a1
--- /dev/null
+++ b/samples/tree/01p_basic_connector.php
@@ -0,0 +1,19 @@
+<?php
+ require_once("../config.php");
+ $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
+ mysql_select_db($mysql_db);
+
+function child_setter($data){
+ //the check is kind of lame, in real table you most probably may have some more stable way to detect is item have childs or not
+ if ($data->get_value("taskId")%100>1)
+ $data->set_kids(false);
+ else
+ $data->set_kids(true);
+}
+
+ require("../../codebase/tree_connector.php");
+ $tree = new TreeConnector($res);
+//
+ $tree->event->attach("beforeRender","child_setter");
+ $tree->render_table("tasks","taskId","taskName","","parentId");
+?> \ No newline at end of file