I'm going through the sample code: Synchronize FeatureTable highlights and selection
https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-row-highlights
1. There is no method highlight in LayerView
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#methods-summary.
2. There is no method ignoreAbortErrors in promiseUtils
https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#methods-summary
I use Angular/TypeScript and get build errors.
Thanks.
Forrest
You could try casting the LayerView as a FeatureLayerView. That type has the highlight method.
(Edit: I don't know about the promiseUtils issue...maybe someone else can answer that)
@mleahy_cl
Thank you for your suggestion!
I tried to use promiseUtils.isAbortError, instead of promiseUtils.ignoreAbortErrors. It looks like working.
If you want to follow that example, you can side-step the issue in typescript by casting (at least temporarily) the promiseUtils object as `any`, and call the `ignoreAbortErrors()` method through that - like so: `(<any>promiseUtils).ignoreAbortErrors();`
That said, the lack of documentation for the method (as far as I can see) and its absence from the typescript interface for the SDK would make me hesitate to rely on the method. If you do the above, I'd be at least cautious when you upgrade to a newer version of the SDK, as an undocumented method like that could behave differently or be removed entirely from the SDK.
That's just my view, anyway...unless someone else from Esri speaks up here and suggests otherwise.
promiseUtils.ignoreAbortErrors in JavaScript
I need the same code, but it doesn't work in TypeScript.
I'm not sure what that method does (I might guess it disables logging abort errors from HTTP requests to the console). But as you've observed, it's not a documented method of promiseUtils.
With that in mind, even though we can see/use the method through the dev console, my own preference would be to ignore that it exists, unless I had some other confirmation (i.e., from Esri documentation) that the method is not going to change or go away in a future version of the SDK.
I debug into JavaScript
There is promiseUtils.ignoreAbortErrors:
But I get error in TypeScript:
Casting the LayerView as a FeatureLayerView works.
Thank you!
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.