Disable or Removing deleteButton from AttributeInspector

925
10
02-20-2014 02:54 AM
shabbirsiddiqui2
New Contributor III
Hi,

I am using Edit Widget, I need to disable or remove the deleteButton from the AttributeInspector which its showing the records of

relationship table.

I tried to do the changes here but no luck.

<esri:AttributeInspector id="attributeInspector"
                                 width="100%" height="100%"
                                 deleteButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorCancel')}"
                                 deleteButtonVisible="false"
                                 excludeFrom="queryRelatedRecords,noRelationships,noRelatedRecords"
                                 okButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorAdd')}"
                                 okButtonVisible="{hostComponent.editEnabled}"
                                 skinClass="com.esri.ags.skins.RelationshipInspectorAttributeInspectorSkin"
                                 updateEnabled="{hostComponent.editEnabled &amp;&amp; hostComponent.featureLayer.isEditable}"/>


Any Idea how can i do it.

Thanks and Regards,
Siddiqui
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Siddiqui,

   In the EditWidget.mxml try adding this line in the basewidget_WidgetConfigLoaded function:

editor.attributeInspector.deleteButtonVisible = false;


When you are asking a question about a widget please post the question in the Flex Viewer forum and not the Flex API forum. This will save me the step of moving your post to the proper forum.
0 Kudos
shabbirsiddiqui2
New Contributor III
Dear Robert,

I tried the code but there is no any effect in the relational table , it still appears.

Siddiqui,

   In the EditWidget.mxml try adding this line in the basewidget_WidgetConfigLoaded function:

editor.attributeInspector.deleteButtonVisible = false;


When you are asking a question about a widget please post the question in the Flex Viewer forum and not the Flex API forum. This will save me the step of moving your post to the proper forum.
0 Kudos
shabbirsiddiqui2
New Contributor III
Hi Robert,

Please try to give me the solution, i tried all the possibilities to pass the value as false but there is no changes in the deleteButtonVisible, although okButtonVisible is working fine when i am passing false. If i have to changes in the skin then could you please provide me the skinClass so that i can apply it.

Thanks,
Siddiqui


Dear Robert,

I tried the code but there is no any effect in the relational table , it still appears.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Siddiqui,

   In the EditWidget change these lines of code:

        <esri:RelationshipInspector id="relationshipInspector"
                                    width="{Math.max(map.infoWindowContent.width, 300)}" height="{Math.max(map.infoWindowContent.height, 300)}"
                                    editEnabled="false"
                                    infoWindowLabel="{relatedRecordsLabel}"
                                    skinClass="widgets.Edit.EditWidgetRelationshipInspectorSkin"/>
0 Kudos
shabbirsiddiqui2
New Contributor III
Robert,

  I don't want to disable the edit feature, just i want to disable the delete button from the relational table.

Thanks,
siddiqui

Siddiqui,

   In the EditWidget change these lines of code:

        <esri:RelationshipInspector id="relationshipInspector"
                                    width="{Math.max(map.infoWindowContent.width, 300)}" height="{Math.max(map.infoWindowContent.height, 300)}"
                                    editEnabled="false"
                                    infoWindowLabel="{relatedRecordsLabel}"
                                    skinClass="widgets.Edit.EditWidgetRelationshipInspectorSkin"/>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
siddiqui,

   Wow today is my day for everyone wanting me to do all the work for them... If you look in the edit widgets folder you will find the EditWidgetRelationshipInspectorSkin.mxml in there you will find this:

        <esri:AttributeInspector id="attributeInspector"
                                 width="100%" height="100%"
                                 deleteButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorCancel')}"
                                 deleteButtonVisible="{hostComponent.editEnabled}"
                                 excludeFrom="queryRelatedRecords,noRelationships,noRelatedRecords"
                                 okButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorAdd')}"
                                 okButtonVisible="{hostComponent.editEnabled}"
                                 skinClass="com.esri.ags.skins.RelationshipInspectorAttributeInspectorSkin"
                                 updateEnabled="{hostComponent.editEnabled &amp;&amp; hostComponent.featureLayer.isEditable}"/>


I guess you could just change that to false.
0 Kudos
shabbirsiddiqui2
New Contributor III
Robert,

I am sorry but my question was same that after passing false its not getting disable. Please refer my starting question with attachment.

Regards,
Siddiqui

siddiqui,

   Wow today is my day for everyone wanting me to do all the work for them... If you look in the edit widgets folder you will find the EditWidgetRelationshipInspectorSkin.mxml in there you will find this:

        <esri:AttributeInspector id="attributeInspector"
                                 width="100%" height="100%"
                                 deleteButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorCancel')}"
                                 deleteButtonVisible="{hostComponent.editEnabled}"
                                 excludeFrom="queryRelatedRecords,noRelationships,noRelatedRecords"
                                 okButtonLabel.addingNewRecord="{resourceManager.getString('ESRIMessages', 'relationshipInspectorAdd')}"
                                 okButtonVisible="{hostComponent.editEnabled}"
                                 skinClass="com.esri.ags.skins.RelationshipInspectorAttributeInspectorSkin"
                                 updateEnabled="{hostComponent.editEnabled &amp;&amp; hostComponent.featureLayer.isEditable}"/>


I guess you could just change that to false.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Siddiqui,

  If you are sure you made my suggested change in the EditWidgetRelationshipInspectorSkin.mxml then there is nothing else I can help you with.
0 Kudos
shabbirsiddiqui2
New Contributor III
Dear Robert,

I tried this before but it was not working so i posted this issue in the forum to get the solution.



Thanks,
siddiqui



Siddiqui,

  If you are sure you made my suggested change in the EditWidgetRelationshipInspectorSkin.mxml then there is nothing else I can help you with.
0 Kudos