Can I enable edit mode programatically?
See original GitHub issueIs there way to enable edit mode programatically? Right now I’m looping through the drawControl toolbars looking for one which has “edit” as an option, and saving it off for later use.
It seems like there should be an cleaner way to do this, but I couldn’t find one.
for(var i in drawControl._toolbars){
if(typeof drawControl._toolbars[i]._modes.edit != 'undefined'){
editHandler = drawControl._toolbars[i]._modes.edit.handler;
}
}
// Much later… editHandler.enable(); // Later still… editHandler.disable();
Issue Analytics
- State:
- Created 10 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
How to programmatically make a List's editMode inactive ...
You can use .environment to bind the List's current edit mode with a @State property, as shown in this awesome article.
Read more >Programmatically Entering Edit Mode
At run time cell edit mode is usually entered by the user's mouse and keyboard interaction with the grid. However, if you choose,...
Read more >Put GridView in Edit Mode Programmatically - MSDN - Microsoft
In the DataSource mode, the GridView doesn't auto-databind for you. If an edit, update, cancel, pager, delete, or sort button is clicked, you ......
Read more >Set component enabled/disabled programmatically in edit ...
I want to set enabled/disabled some lookup components if a checkbox is checked or not. And refresh if checkbox state changes.
Read more >Custom button does not trigger editMode but EditButton does
It's hard to test your code as you are not showing many parts used in your code. But if I fill such parts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The API seems kind of inflexible. Everything relies on the default toolbar. Would be greatly appreciated if everything could be done in code without any default UI.
I had some problems with the solution from my last comment (regarding “undo’ing” edit changes) so I came up with another one (which also seems a bit nicer):
To manually enable editing on a certain layer:
And to disable it: