I am building a custom Widget using React and am having difficulty in adding new layer information to the Attribute Table. I found the following resource: Send a layer to the Attribute Table widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS fo... but it uses a number of Dojo methods to bind the call to publishData which I am having difficulty calling from React.
Is there a way to make the call to publishData to the Attributes Table using plain JavaScript without Dojo helper methods like hitch, own, and on?
Thanks
Solved! Go to Solution.
John,
Own is just a way that dojo widget clean up event handlers when a widget is destroyed. You can just not use that.
John,
Hmm. I does not matter that you have chosen to use the react framework for you development the JS API still uses dojo so I am not sure why you would be having issues using and dojo classes like on or lang. Now own is a different subject as that is part of the dojo widget portion.
Robert,
I have been able to import dojo/_base/lang with success, but I have had no success with own. I did try to import dijit/Destroyable since that seems to house own, but still ran into problems using it. I'm wondering if part of the problem is with how 'this' is referenced from within the React component versus a regular widget.
John,
Own is just a way that dojo widget clean up event handlers when a widget is destroyed. You can just not use that.
Robert,
Thanks for your help. I was able to remove the own() call and then break apart the dojo version to identify the layer and the widget currently in use, and from there could call publishData on the widget.
Thanks,
John