dhtmlxconnector:connector_object_methods [DHX documentation]

PHP Connector DHTMLX

Connector object

add_section

(available from version 1.5 and applicable just to DataConnector/JSONDataConnector)
adds the first child tag(section) to data

$conn->add_section($name, $value);

Parameters:

  • $name - the section name
  • $value -the section value

See also:

dynamic_loading

enables the dynamical loading mode for connector.

$conn->dynamic_loading([$rowsNum]);

Parameters:

  • tree, treegrid - no parameters
  • grid - number of rows which should be initially loaded (the value should be more than number of rows visible in grid, or at least any positive number)
  • combo - maximum number of options which server will send for a single data request in autocomplete mode

See also:

enable_log

enables logging for connector.

$conn->enable_log("path to log file");

Parameters:

  • path - absolute or relative path to text file where log will be written.

See also:

is_select_mode

returns current active mode.

$conn->is_select_mode();

Parameters:

  • none.

Returns:

  • true, if select mode is active.
  • false, if update mode is active.

render_array

configures connector to take data from a PHP array which can be filled by any kind of external logic.

$conn->render_array($data,$id,$text,$extra,$relation_id);

Parameters:

  • $data - name of PHP array.
  • $id - name of id field.
  • $text - comma separated list of data fields.
  • $extra - comma separated list of extra fields, optional.
  • $relation_id - used for building hierarchy in case of Tree and TreeGrid.

See Also:

render_sql

configures connector to take data based on provided SQL text.

$conn->render_sql($sql,$id,$text,$extra,$relation_id);

Parameters:

  • $sql - any sql code, which will be used as a base for data selection.
  • $id - name of id field.
  • $text - comma separated list of data fields.
  • $extra - comma separated list of extra fields, optional.
  • $relation_id - used for building hierarchy in case of Tree and TreeGrid.

See Also:

render_complex_sql

configures connector to take data based on provided SQL text.
Works similar to render_sql, but have 2 differences:

  1. Uses provided sql exactly as it is;
  2. Can be used only for data loading (for data saving you can use separate connector, event handlers, or custom model).

The method can be used to call stored procedures in the database.

$conn->render_complex_sql($sql,$id,$text,$extra,$relation_id);

Parameters:

  • $sql - any sql code, which will be used as a base for data selection or the name of a stored procedure.
  • $id - name of id field.
  • $text - comma separated list of data fields.
  • $extra - comma separated list of extra fields, optional.
  • $relation_id - used for building hierarchy in case of Tree and TreeGrid.

See Also:

render_table

configures connector to take data from single table.

$conn->render_table($table,$id,$text,$extra,$relation);

Parameters:

  • $table - name of table.
  • $id - name of id field.
  • $text - comma separated list of data fields.
  • $extra - comma separated list of extra fields, optional.
  • $relation_id - used for building hierarchy in case of Tree and TreeGrid.

Description:

  • If you want to render all fields from DB ( except of identity field), you can use simplified command:

    $conn->render_table($table);

See Also:

set_encoding

allows you to set encoding that will be applied to generated XML (default encoding is UTF-8).

$conn->set_encoding("iso-8859-1");

Parameters:

  • encoding name.

set_limit

limits the number of data items that will be loaded to a component.

$conn->set_limit([$rowsNum]);

Parameters:

  • number of data items which should be loaded