Hi,
My html was working when I loaded from XML file, but I will paste, in case I made some new error.
var treegrid = dhxLayout.cells("a").attachGrid();
treegrid.setImagePath("codebase/imgs/tree_blue/");
treegrid.setSkin("light");
treegrid.setHeader("a,b,c,d,e,f,g");
treegrid.setInitWidths("*,220,80,80,80,80,*");
treegrid.setColAlign("left,left,left,left,left,left,left");
treegrid.setColTypes("tree,ed,ro,ed,ed,ed,ed");
treegrid.setColSorting("str,str,str,str,str,str,str");
treegrid.enableDragAndDrop(true, true);
treegrid.setDragBehavior("complex", true);
treegrid.enableContextMenu(contextmenu);
treegrid.init();
//treegrid.loadXML("SampleTreeGrid.xml");
treegrid.loadXML("connect/get_treegrid.php");
When I switch to load from MySql, using grid_connector.php and “new GridConnector($res);”, my tree became flat.
When I switched to treegrid_connector.php and “new TreeGridConnector($res)”, I have now only one row, the parent level 0.
<?php
require_once('../connect/config.php');
require_once("../codebase/treegrid_connector.php");
$res=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db("isti_ab");
$treeGrid = new TreeGridConnector($res);
$treeGrid->dynamic_loading(100);
$treeGrid->render_sql("Select * from my_table","node_id","node_name,node_parent","","node_parent");
?>
When I switched to treegridmultitable_connector.php and “new TreeMultitableConnector($res)”, I got an error popup with XML in it:
<?xml version='1.0' encoding='utf-8' ?><tree id='0'><item id='0#1' text='First Tree Leaf' child='1' ></item>...
This looks like the XML for a Tree and not for a TreeGrid?
…
Is there somewhere an example of the PHP used for TreeGrid with Connector? And the html to match with it. Is $relation_id supposed to be id of the parent item?
Thanks.