dhtmlxconnector:grid_columns [DHX documentation]

PHP Connector DHTMLX

SELECT/COMBO BOX COLUMNS IN GRID

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

By default, grid will use DISTINCT select against related field, and fetch all possible options.
If you need to define custom list of options you can use one of 2 ways:

  • hardcoded list
$grid->set_options("item_nm",array("1" => "one", "2"=>"two","3" => "three")); // value => label
$grid->render_table("grid50","item_id","item_nm,item_cd");
  • list created on base of different table
$options = new OptionsConnector($res);
$options->render_table("countries","country_id","country_id(value),country_name(label)");
$grid->set_options("item_nm",$options);
 
$grid->render_table("grid50","item_id","item_nm,item_cd");

co/combo type

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

coro type:

  • only labels need to be provided
  • connector may define only label parameter