Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: JoinDataSource

require(["esri/layers/JoinDataSource"], function(JoinDataSource) { /* code goes here */ });

Description

(Added at v2.7)
The JoinDataSource class defines and provides information about the result of a join operation. Nested joins are supported and are created by specifying either the leftTableSource or rightTableSource to be the joined table.

The output type is determined by the leftTableSource. If the leftTableSource is a table then the resulting join table is a table. If the leftTableSource is a layer then the join result will be a layer.

Note: For the best performance, the left and right table sources should point to the same workspace and the table keys should be indexed.

See also

Samples

Search for samples that use this class.

Class hierarchy

esri/layers/DataSource
|_esri/layers/JoinDataSource

Constructors

NameSummary
new JoinDataSource(json?)Creates a new JoinDataSource object.

Properties

NameTypeSummary
joinTypeStringThe type of join that will be performed.
leftTableKeyStringThe key field used for the left table source for the join.
leftTableSourceLayerSourceThe data source to be used as the left table for the join operation.
rightTableKeyStringThe key field used for the right table source for the join.
rightTableSourceLayerSourceThe data source to be used as the right table for the join operation.

Methods

NameReturn typeSummary
toJson()ObjectConverts object to its ArcGIS Server JSON representation.
Constructor Details

new JoinDataSource(json?)

Creates a new JoinDataSource object.
Parameters:
<Object> json Optional JSON object representing the JoinDataSource.
Sample:
require([
  "esri/layers/JoinDataSource", ... 
], function(JoinDataSource, ... ) {
  var dataSource = new esri.layers.JoinDataSource();
  ...
});
Property Details

<String> joinType

The type of join that will be performed.
Known values: left-outer | left-inner
Sample:
dataSource.joinType = "left-inner-join";

<String> leftTableKey

The key field used for the left table source for the join.
Sample:

dataSource.leftTableKey = "sde.sde.states.state_name";

<LayerSource> leftTableSource

The data source to be used as the left table for the join operation. Determines the output join table type. If the leftTableSource is a table then the output is a table. If the leftDataSource is a layer then the resulting join table is a layer.
Sample:
require([
  "esri/layers/JoinDataSource", "esri/layers/LayerDataSource", "esri/layers/TableDataSource", ... 
], function(JoinDataSource, LayerDataSource, TableDataSource, ... ) {
  var dataSource = new JoinDataSource();

  var leftTableSource = new LayerDataSource();
  leftTableSource.dataSource = new TableDataSource({
    workspaceId: "d203_db",
    dataSourceName: "sde.sde.states"
  });

  dataSource.leftTableSource = leftTableSource;
  ...
});

<String> rightTableKey

The key field used for the right table source for the join.
Sample:

dataSource.rightTableKey = "sde.sde.statecapitals.state_name";

<LayerSource> rightTableSource

The data source to be used as the right table for the join operation.
Sample:
require([
  "esri/layers/JoinDataSource", "esri/layers/LayerDataSource", "esri/layers/TableDataSource", ... 
], function(JoinDataSource, LayerDataSource, TableDataSource, ... ) {
  var dataSource = new JoinDataSource();

  var rightTableSource = new LayerDataSource();
  rightTableSource.dataSource = new TableDataSource({
    workspaceId: "d203_db",
    dataSourceName: "sde.sde.statecapitals"
  });
  dataSource.rightTableSource = rightTableSource;
  ...
});
Method Details

toJson()

Converts object to its ArcGIS Server JSON representation.
Return type: Object
Show Modal