I am using FeatureTable of JavaScript API 3.19.
featuretable is long list with scrolling and I am trying to scroll to the row when corresponding feature is selected on the map. I is have set syncSelection: true , so table row get highlighted , but I can't find a way to scroll to the selected row.
Anyideas will really help.
Thanks,
Vik
Hey Vik,
You can use selectRows() function to scroll to the selected rows. You will need the the ObjectID for each row that you want selected, it will only scroll to the first one in the set.
https://developers.arcgis.com/javascript/3/jsapi/featuretable-amd.html
look for
Allows users to select rows(s) based on row id(s). Selected rows will be highlighted while other records are still visible in the table. (Added at v3.18)
Seems to not working for me.
I have custom panel in my app, where I am rendering the feature table. Its a custom UI design, tabs includes tabs and other div hierarchies . Could the design and css of parent container be the problem?
I don't think that would cause an issue. I use it in a complex UI as well and it works. Hard to say without seeing the application. Are you using the ArcGIS Javascript API 3.18 or higher?
I am using 3.15
FeatureTable | API Reference | ArcGIS API for JavaScript 3.25
<Boolean > scrollToRow | Optional | Indicates whether the table should scroll to selected rows. If multiple row ids are provided, scrolls to first row in the array. Default value: false. Note that if scrollToRow is true, selection only occurs if rows are already displayed within the table. This is a known limitation with Dojo's dgrid. |
selection only occurs if rows are already displayed within the table