Hi Stanislav,
Following is the code snipet,
$gridConn = new TreeGridMultitableConnector($myDb->_dbcnx, “MySQL”);
$gridConn->enable_log(“log.txt”);
$gridConn->event->attach(“beforeUpdate”, “updateFunc”);
$gridConn->event->attach(“afterInsert”, “insertFunc”);
// Grid configuration
$config = new GridConfiguration();
$config->setHeader(array(“col1”, “col2”, “col3”, “col4”));
$config->setColTypes(array(“tree”, “ed”, “co”, “ro”));
$config->setColIds(array(“col1”, “col2”, “col3”, “col4”));
$config->attachHeader("#numeric_filter,#text_filter,#text_filter");
// Grid load
$level = $gridConn->get_level();
$gridConn->setMaxLevel(1);
$level = $gridConn->get_level();
switch ($level) {
case 0:
$gridConn->set_config($config);
$query = sprintf(“select * from table”);
$gridConn->render_sql($query, "id", "col1,col2,col3,col4");
break;
case 1:
$queryChild = sprintf("select * from table2");
$gridConn->render_sql($queryChild, "child_id", "childCol1,'','',childCol4","parent_id");
break;
}
In the first column of type tree, parent should be editable and not the child. On the child rows, only the childcol4 should be editable. How do i achieve this. Also how to attach on update event for child rows oneditcell of col4.