Check documentation for the latest version 6.0 of dhtmlxSuite Select/Combobox Columns in Grid DHTMLX Docs

Select/Combobox Columns in Grid

When on the client side you specify co/coro/combo columns (combo-box/select) in a grid, the grid will automatically request data for them in the same manner as for the filtering options.

Grid will use the DISTINCT select against the related field by default, and fetch all possible options.

If you need to define a custom list of options you can use one of 2 ways:

  • a hardcoded list
$grid->set_options("item_nm",array("1"=> "one", "2"=>"two","3"=> "three")); 
  • a list created on the base of a different table
$options = new OptionsConnector($res,"MySQL");
//or $options->render_sql("Select country_id as value,country_name as 
//label from countries","country_id","country_id(value),country_name(label)");

co/combo type

  • when using a predefined list of data, both values and labels need to be provided
  • when using a connector, there must be two fields selected, one as (value), the second one as (label)

coro type:

  • only labels need to be provided
  • a connector may define only the label parameter
Back to top