The toolbar Editor definition
Sample ToolBar View XML Configuration
<ActionToolBars>
<ActionToolBar Name="View">
<Option Name="Edit" ImageUrl="/_layouts/images/edit.gif" Action="Edit" />
<Option Name="Delete" ImageUrl="/_layouts/images/delete.gif" Action="Delete" />
<Option Name="New" ImageUrl="/_layouts/images/newrole.gif" Action="New" />
</ActionToolBar>
<ActionToolBar Name="Edit">
<Option Name="Update" ImageUrl="/_layouts/images/save.gif" Action="Update" />
<Option Name="Back" ImageUrl="/_layouts/images/back.gif" Action="Back" />
<Option Name="Delete" ImageUrl="/_layouts/images/delete.gif" Action="Delete" />
</ActionToolBar>
<ActionToolBar Name="New">
<Option Name="Save New" ImageUrl="/_layouts/images/save.gif" Action="Create" />
<Option Name="Back" ImageUrl="/_layouts/images/back.gif" Action="Back" />
</ActionToolBar>
</ActionToolBars>
There are three toolbars that we can configure: View, Edit and New
These will be displayed in these cases:
View: When we see a record
Edit: When we edit an existing record
New: When we register a new record
ActionToolBar – Element for the menu toolbar configuration
It contains this toolbar different options / buttons
Attributes:
Name - (string) -Contains the action that will show this toolbar.
Example
<ActionToolBar Name="View">
<Option ... />
</ActionToolBar>
Contains: Option
Option – Element for the toolbar option or button
Attributes:
Name - (string) - Description, text that will appear in option
ImageUrl - (string) -- image URL -ex: /_layouts/images/edit.gif
Action - (string) - Action to be carried out when you click on this button.
The predefined actions are:
Edit: Activates the registration edit mode and loads the "Edit" toolbar
Delete: Deletes the registry that is being displayed (always ask to verify)
New: Activates the edit mode with the fields values by default to insert a new record, loads the "New" toolbar
Update: Updates the database (it must be used with Edit) , performs UPDATE
Create: Create the new register (it must be used with New) performs INSERT
Example
<Option Name="Edit" ImageUrl="/_layouts/images/edit.gif" Action="Edit" />