Select to view content in your preferred language

In FeatureTable filtered by definition query get ObjectIds of current page

109
0
4 weeks ago
SebastianKrings
Frequent Contributor

Some new tough nut here.

I want to receive the object ids of only those features which are currently shown on the current page of the feature table which may is filtered due to a defintion query on the layer:

  1. A Layer shows some features in the map.
  2. We select some features by geometry.
  3. Their object ids + their layer are sent to a FeatureTable (via featureTableProperties) showing them
  4. Afterwards a definitionQuery is applied to the layer which also reduces the features shown in the table
  5. Now I would like to get all objectIds shown in the FeatureTable (of the current page).

I find a size attribute telling me how many are shown right now, but I dont find a reference to the features itself.

I tried to ask AI first but that did not help much. It told me about grid.rows and .store and a function to check if a given features is visible in the table. Nothing which was visible for me while debugging.

I have access to the current FeatureTable instance and to the unfiltered objectIds.

 

const featureTable = this.featureTable();
const allIds = this.allObjectIds(); // original list of object ids sent via properties on widget generation
const allIds2 = featureTable.objectIds(); // always results to the same ids as 'allIds'
const sizeShownItems = featureTable.size; // amount of items only shown
const shownItems = ???; // this is what I want

 

Here I am stuck.

If helpful the way I create the table (simple default I guess):

 

const widget = new FeatureTable({
   ...featureTableProperties,
   container: this.tableElementRef?.nativeElement,
   view: mapView,
   visibleElements: {
      menu: true,
      menuItems: {
         refreshData: false,
         clearSelection: false,
         selectedRecordsShowSelectedToggle: false,
         zoomToSelection: false,
         toggleColumns: true
      }
   }
});

 

0 Kudos
0 Replies