How to hide unwanted tools in editor toolbar widget?

3813
15
Jump to solution
11-22-2016 09:11 AM
KushendraShah1
New Contributor III

I need to customize the editor toolbar widget by hiding the list of unwanted tools for me in editor toolbar widget. Is there way I could get this done deactivating and hiding such tools in javascript or css?. It seems like those tools came as default in editor widget. However I was able to remove the display of some tools/buttons in dropdown like delete, AddToSelection, NewSelection, Attributes, ClearSelection. Here is the remaining buttons/tools that I wanted to hide or remove from the widget for my application and only keep undo/redo button. Appreciate for any help. Thanks

0 Kudos
15 Replies
CharlesBailey3
Occasional Contributor II

Robert, how would this be incorporated into an existing edit widget? I'm trying in the startup: function in the widget.js - I think only the query line is needed and I can use Clazz for the domNode, but it is giving an error: query is not a function.

SyntaxEditor Code Snippet
 startup: function() {             query(".dijit.dijitReset.dijitInline.dijitLeft.dijitComboButton", Clazz.domNode).forEach(function(node){             domStyle.set(node, "display", "none");                });

Thanks! cob

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cob,

   Does the Edit widget have dojo/query in the require array?

0 Kudos
CharlesBailey3
Occasional Contributor II

Yes I added it. One thing I wondered about was the _base array entry. In

your code it corresponds to arrayUtils but in the widget.js it's just

array. Is this a problem? Not getting this to work I put the lines in the

style.css file like Rob and it works the first time it opens, but the

second time the separator lines come back and the next time the point

creator comes back (but doesn't work). Weird huh? Thanks Robert- cob

On Fri, Jun 29, 2018, 7:37 PM Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

cob,

  You would need to change to use array instead of arrayUtils (if that is what the widget has).

0 Kudos
CharlesBailey3
Occasional Contributor II

OK, I just used array - originally I had both in the functions but only array in the define because it was referring to both in the different codes. But doesn't make any difference. Do I need to include some more code?

But what do you think about the style.css thing? Something is creating new dividers and create point classes the second and third time it opens, with sequential number references i.e. esri_dijit_editing_7 or whatever. It also isn't showing the onClose log in the console. I assume that fires when the widget button is clicked when the widget is open - I don't see any other controls to close it. But only the onOpen fires when opened and closed. After the third open when it has added the point editing button, it stays static from then on and doesn't create any more elements on the toolbar. What could the deal be? Thanks again, cob

0 Kudos
CharlesBailey3
Occasional Contributor II

I can't get the query method to work - no error but it has no effect. I'm working with an app template in WAB 2.8 with the edit widget already added so the html sample isn't all that helpful - the editor startup interferes with the Clazz variable somehow. The style.css method works on startup but adds the nodes back when closed and reopened. I can't figure out where this is happening. I copied the startup code into the onOpen but it still added it back. Can't believe how difficult it is to do something so simple... thanks Robert - cob

0 Kudos