Selected rows in a FeatureTable

402
3
11-12-2020 02:29 PM
KenBuja
MVP Honored Contributor

There doesn't seem to be a way of getting the selected rows easily from a FeatureTable (v 4.17). The 3.x version has the selectedRows property...am I missing something? Currently, I am using the selection-change event to write the added and removed property arrays to a separate array

    featureTable.on('selection-change', (event) => {
      if (event.added.length > 0) filterArray.push(event.added[0].feature.attributes[valueString]);
      if (event.removed.length === 1) {
        const i = filterArray.indexOf(event.removed[0].feature.attributes[valueString]);
        filterArray.splice(i, 1);
      } else if (event.removed.length > 0) {
        filterArray = [];
      }
    });

 

Tags (1)
3 Replies
KavishGhime3
New Contributor II

Hello @KenBuja 

In the 4.x API reference, I cannot see the equivalent property of "selectedRows" which returns the name-value pair object in 3.x API.

In API 4.x, FeatureTable is still in Beta and new capabilities will be added in upcoming releases. For a more comprehensive list of limitations, please refer to the widget's API Reference documentation.

Thanks,

MichaelKarikari1
New Contributor III

I still don't see selectedRows as API option. Is it safe to say it is still not available yet and the poster except is the best option for now?

ZachPorteous
New Contributor II

That would be a great feature!!

0 Kudos