I am not able to get the treegrid grouped
I am using dhtmlx connector withtreegridgrouped connector
The controller code is given below: (I want the grouping by ag cell
$tconn = new TreeGridGroupConnector($mysqli, "MySQLi");
$tconn->configure("dummy", "rqid", "ag,rq,rqid,agid","","ag");
$tconn->useModel(new AGLModel());
$tconn->render();
The Model is:
[code]
class AGLModel{
function get($request){
global $db,$account;
$result = $db->query(sprintf(“SELECT agrp.title as ag,
acq.title as rq,
acq.id as rqid,
agrp.id as agid
FROM account_questions acq
LEFT JOIN a_q_grp_items agitems ON acq.id = agitems.item_id
LEFT JOIN a_q_grp agrp ON agitems.account_question_group_id = agrp.id
WHERE agrp.account_id = %d
AND agitems.item_type=‘QUESTION’”,$account->id));
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$data[] = array(‘ag’ => $row[“ag”], ‘rq’ => $row[“rq”],‘rqid’ => $row[“rqid”],“agid” => $row[“agid”]);
};
};
return $data;
}
function insert($action){
}
function update($action){
}
}[/code]
The grid code is:
var dpagl = new dataProcessor("/app/ajax_datavalues/<?=$account->id?>/agl"); //account group to question linker
dpagl.action_param = "dhx_editor_status";
aglgrid = agLayout.cells("a").attachGrid();
aglgrid.setHeader("Account Groups,Rating Questions,rid,agid");
aglgrid.setInitWidths("250,*,10,10");
aglgrid.setColAlign("left,left,left,left");
aglgrid.setColTypes("tree,ro,ro,ro");
aglgrid.setColSorting("str,str,int,int");
aglgrid.enableAutoWidth(true);
aglgrid.init();
aglgrid.load("/app/ajax_datavalues/<?=$account->id?>/agl/",function(){
});
dpagl.init(aglgrid);
The output I’m getting is
How do I group ‘Rating Questions’ based on its account groups using the connectors?