Skip to content

Commit

Permalink
use layer fields rather than popup by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhauck committed Nov 30, 2023
1 parent 77a2768 commit fa4486a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/layer-table/layer-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ export class LayerTable {
this._allIds = [];
this.featureSelectionChange.emit(this._selectedIndexes);

const columnTemplates = this._getColumnTemplates(this._layer.id, this._layer?.popupTemplate?.fieldInfos);
const columnTemplates = this._getColumnTemplates(this._layer.id, this._layer?.fields);
this._allIds = await queryAllIds(this._layer);

if (!this._table) {
Expand Down Expand Up @@ -1650,7 +1650,7 @@ export class LayerTable {
*/
protected _getColumnTemplates(
id: string,
fieldInfos: __esri.FieldInfo[]
fieldInfos: __esri.Field[]
): __esri.FieldColumnTemplate[] {
let layerInfo: ILayerInfo;
this.mapInfo.layerInfos?.some(li => {
Expand All @@ -1664,17 +1664,17 @@ export class LayerTable {
if (fieldInfos) {
columnTemplates = columnTemplates ? columnTemplates.map(columnTemplate => {
fieldInfos.some(fieldInfo => {
if (fieldInfo.fieldName === columnTemplate.fieldName) {
columnTemplate.label = fieldInfo.label;
if (fieldInfo.name === columnTemplate.fieldName) {
columnTemplate.label = fieldInfo.alias;
return true;
}
});
return columnTemplate;
}) : fieldInfos.map(fieldInfo => {
return {
type: "field",
fieldName: fieldInfo.fieldName,
label: fieldInfo.label
fieldName: fieldInfo.name,
label: fieldInfo.alias
} as __esri.FieldColumnTemplate;
})
}
Expand Down
3 changes: 3 additions & 0 deletions src/demos/crowdsource-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
demo.mapInfos = [
...custom,
...[{
id: "7197542839d948258c7862b33f9d96ad",
name: "Edit Poly my data"
}, {
id: "ce3dec81bf714d3bb71da9691ab686d1",
name: "Popup Configured Map",
// filters: {},
Expand Down

0 comments on commit fa4486a

Please sign in to comment.