DHTMLX Docs & Samples Explorer

Select box columns in a grid

When grid has co|coro columns ( select|combo-box ), it will automatically request data for it in same manner as for filtering options. So it possible to use similar way of logic to define which list of values need to be used in select|combo inside the grid.

  • automatic - if no custom instruction provided , grid will use DISTINCT select against related field, and fetch all possible options
  • 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");

In case of options in grid

  • 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)

In case, when connector used only to fill select-filter

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