Try our conversational search powered by Generative AI!

Sort order for custom actors

Vote:
 

Hi!

I have created a custom actor that inherits Episervers SendEmailAfterSubmissionActor.

I want to set sort order for my actor so that it's visually presented between the two standard Episerver actors in edit mode on the settings tab for the form.

Any ideas on how I can do this?

Best regards Kristian

#188770
Mar 02, 2018 13:54
Vote:
 

You can create EditorDescriptor which can set Order of the property. Here is how I change the EmailActor order:

[EditorDescriptorRegistration(TargetType = typeof(IEnumerable<EmailTemplateActorModel>), UIHint = ConstantsFormsUI.UIHint_EmailTemplateActorEditor, EditorDescriptorBehavior = EditorDescriptorBehavior.OverrideDefault)]
public class EmailTemplateActorCollectionEditorDescriptor : CollectionEditorDescriptor<EmailTemplateActorModel>
{
    public EmailTemplateActorCollectionEditorDescriptor()
    {
        ClientEditingClass = "epi-forms/contentediting/editors/EmailTemplateActorEditor";
    }

    public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
    {
        GridDefinition.GridSettings["richTextColumns"] = new[] { "body" };

        base.ModifyMetadata(metadata, attributes);
        metadata.Order = 100;
    }
}
#188803
Mar 05, 2018 4:51
Vote:
 

I tried to create an EditorDescriptor like yours but nothing happens. The sort index is still -5300 for my actor.

Can't figure out what I'm missing...

/Kristian

#189247
Mar 14, 2018 8:52
Vote:
 

Could you post your code of the descriptor here? Could you set a break point and debug if it is running into your code?

#189248
Mar 14, 2018 8:59
Vote:
 

I used your code and now it works. I finally got my actor where I wanted. I had to set sort order for the WebhookActor also. I think the sort order is acting kind of strange. The properties on the settings tab for the form is ordered very differently depending on what sortorder i give the emailActorModel. Sometimes the published, created and modified fields are on top of the page and sometimes in the bottom. In the database the sortorder still is -5300.

Maybe I'm looking at the wrong place.

#189284
Mar 14, 2018 14:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.