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
Properties
Methods
toJson() | Object | Converts object to its ArcGIS Server JSON representation. |
Constructor Details
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
The type of join that will be performed.
Known values: left-outer | left-inner
Sample:
dataSource.joinType = "left-inner-join";
The key field used for the left table source for the join.
Sample:
dataSource.leftTableKey = "sde.sde.states.state_name";
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;
...
});
The key field used for the right table source for the join.
Sample:
dataSource.rightTableKey = "sde.sde.statecapitals.state_name";
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
Converts object to its ArcGIS Server JSON representation.