OptionsConnector SQL query doesn't execute

Hi Folks,

I’m having an issue trying to set the options for a select box via the GridConnector. The problem is that the query for the OptionsConnector doesn’t ever seem to run, no matter what I do. (I’ll probably have some stupid typo or something that I just can’t see).

I have enabled logging… and all I ever see in the logs is the render_sql that happens on the GridConnector.

Here’s the code:

<?php
	require("../include/lib/dhtmlx/connector/codebase/grid_connector.php");
	
	if(isset($_REQUEST['id']) && isset($_REQUEST['loc'])){
	    $rowId = str_replace(",", "','", $_REQUEST['id']);
	    
	    $dbh = mysql_connect("localhost", "user", "password");
	    mysql_select_db("somedb");
	    
	    $gridConn = new GridConnector($dbh, "MySQL");
	    $optsConn = new OptionsConnector($dbh, "MySQL");
	    
	    $gridConn->enable_log("grid.log",true);
	    $optsConn->enable_log("grid.log",true);
 
	    $opt_query = "select smash_settings.id as value, smash_settings.name as label ".
	                 "from smash_settings where smash_settings.default_settings=1";
	    
	    $optsConn->render_sql($opt_query, "", "value,label");
	    $gridConn->set_options("ioid", $optsConn);
	    
	    $query = "select 0 as selected, endpoints.uuid as uuid, endpoints.name as epname, endpoints.os_type as ostype, ".
	             "endpoints.io_program_ver as iover, smash_settings.id as ioid, smash_settings.* from endpoints left join smash_settings on ".
                 "endpoints.io_settings_id = smash_settings.id where ";
        
	    if($_REQUEST['loc'] === "menuA"){
	        $query .= "endpoints.configid ";
	    } else if ($_REQUEST['loc'] === "menuC"){
	        $query .= "endpoints.uuid ";
	    } else {
	        exit;
	    }
	    
	    $query .= "in ('$rowId') order by endpoints.name";
	    
	    $fieldset = "selected,epname,ostype,iover,ioid,smash_binary_path,smash_targets_path,smash_patterns_path,".
	                "smash_stop_error,smash_verify,smash_blocksizes,smash_functions,smash_error_file,".
	                "smash_display_time,smash_queue_params,smash_other";
	    
	    $gridConn->render_sql($query, "uuid", $fieldset);  
	}
?>

If anyone can clue me in, that would be great.

Thanks,

Andy

Code looks fine, there is no any visible issues with it
Which column type is related to ioid in the client side grid ?
Do you have connector.js on the client side ?

Ahh… looks like I was missing the “connector.js” piece. I knew I was overlooking something. I had a similar connector working for another project and just couldn’t figure out what was different.

This is working as expected now thanks to your excellent reply. Thanks for the assistance.

Andy