Prevent attachment deleting in attachment editor.

826
7
Jump to solution
05-15-2013 04:31 AM
AndrejTrunkl1
Esri Contributor
Hi all.

Becouse of a specific workflow we would like to prevent the user to delete current attachments of one selected feature in attachmnet editor. I have acchivet this with acessing to the dom and hiding the "X" elements. My problem is that I must use an timeout, since attachments are not visible till the widget is fully loaded.

So if someone has a suggestion on how to acess this elements earlyer or has a mor elegant solution. I would appriciate the help.

Bye Andrej
0 Kudos
1 Solution

Accepted Solutions
JianHuang
Occasional Contributor III
You can get a reference to the attachmentEditor by:
attributeInspector._attachmentEditor

View solution in original post

0 Kudos
7 Replies
JianHuang
Occasional Contributor III
You can set the feature service editing capabilities as create only. Then, attachmentEditor would not allow to delete.

If this doesn't work for your case, you can try this code right after startup() function call.
attachmentEditor._deleteBtnHtml = "";
0 Kudos
AndrejTrunkl1
Esri Contributor
thanks for the replay

I gues the problem with the first solution that it will not allow delete of features eather, so I will try the second one.
I will ost the results

bye Andrej
0 Kudos
AndrejTrunkl1
Esri Contributor
greetings,

I have tried to find the _deleteBtnHtml of the attachmentEditor but i can find it.

I am not using it as a stand alone module but together with attribute editor so attreditor is fiering the instatiation and the startup of the widget.

after this I am acessing the attachmenteditor with : dijit.getEnclosingWidget(dojo.query(".attachmentEditor div")[0])

btw. I am using 3.2 javascript api

sorry for bother and thanks for the replay

bye andrej
0 Kudos
JianHuang
Occasional Contributor III
When you say attribute editor, do you mean Editor widget or AttributeInspector widget?
0 Kudos
AndrejTrunkl1
Esri Contributor
I mean AttributeInspector

bye andrej
0 Kudos
JianHuang
Occasional Contributor III
You can get a reference to the attachmentEditor by:
attributeInspector._attachmentEditor
0 Kudos
AndrejTrunkl1
Esri Contributor
thank you for your help.

bye Andrej
0 Kudos