Select to view content in your preferred language

how to modify Editor template

1074
5
03-07-2011 12:44 AM
yihuilai
Emerging Contributor
i was used this example http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=EditorWithToolbar

Can anyone tell me how to modify the editortool style in Editor component...???

for example there are "deleteButton" and "redoButton" methods in Editor, i want to know is there any

method to change these two method(buttons) style and  x�?�y coordinate?

i was tried to use
myEditor.deleteButton.x = 50;

but when i run the application, it shows error 1009 cannot access a property or method of a null object reference...
Tags (2)
0 Kudos
5 Replies
DasaPaddock
Esri Regular Contributor
You can create a custom skin. See the EditorSkin.mxml file in the skins folder that's in the api zip download.
0 Kudos
JHayes
by
Frequent Contributor
I'm only a few days in with the Flex API and things having been going well.  However, I would also like to customize the editor skin.  I see that you do this in the editorskinmxml.  Bit Can you point me in the direction for resources on how to do this?  So I just edit the editorskin.mxml? Or Should I create a custom/new skin.mxml?

Thanks,
Joe
0 Kudos
BjornSvensson
Esri Regular Contributor
Can you point me in the direction for resources on how to do this?


http://help.arcgis.com/en/webapi/flex/help/index.html#/Styling_and_skinning_the_scale_bar/017p000000...

http://help.arcgis.com/en/webapi/flex/help/index.html#/Styling_and_skinning_navigation/017p000000170...

So I just edit the editorskin.mxml? Or Should I create a custom/new skin.mxml?


The best way is to make a copy of the existing skin.  Then use that skin either by setting the skinclass in the Style section as in the help doc above, or just set the skinClass property on the component you are skinning.  The latter is the way it is done in the Flex Viewer.
<esri:Editor id="myEditor" 
    skinClass="MyEditorSkin"
.../>
0 Kudos
JHayes
by
Frequent Contributor
Bjorn,

Thanks for the resources.  However, I've completely confused myself.  All I really want to do is remove the "Delete" button from the InfoWindow in the default editor.

I created a copy of the InfoWindow skin, reference it in my application, looked high and low in the code, but for the life of me I don't know how to remove that button.  Can you tell me how?

Thanks,
Joe
0 Kudos
JHayes
by
Frequent Contributor
Hello,

I find it a bitter/sweet victory today to find out that all you have to do is add the - deleteEnable="false" - property to the esri:Editor package. 
<esri:Editor id="myEditor" bottom="4" width="200" height="120" deleteEnabled="false" 
      geometryService="{myGeometryService}" horizontalCenter="-204" map="{myMap}"
      skinClass="com.esri.ags.skins.EditorSkin"/> 
Wow.  I feel relieved and stupid at the same time (but mostly relieved).  Because now I understand how to use the "commands" in the Public Properties section of the API reference.  My Flex API development world just got a whole lot bigger.  I suppose this is part of "taking you lumps" as in most cases when you jump into something with no prior experience. 

However, it would be nice if there were a paragraph or two in the space just below the "All Packages" and "All Classes" headings generally explaining what packages and classes are, and how to use them.  Maybe a short example? 

Anyway, I still appreciate everyone's help on this post.

Joe
0 Kudos