Check documentation for the latest version 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 the grid, the grid will automatically request data for them in the same manner as for filtering options.

By default, the grid will use DISTINCT select against the related field, 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
HashMap<String,String> c2 = new HashMap<String,String>();
c2.put("91", "one");
c2.put("75", "two");
grid.set_options("item_nm",c2);
  • a list created on the base of a different table
BaseConnector options = new OptionsConnector(conn);
options.render_table("countries","item_id","item_id(value),item_nm(label)");
 
grid.set_options("item_nm",options);

co/combo type

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

coro type:

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