Editor Types

Estrusco edited this page Apr 22, 2016 · 8 revisions
Clone this wiki locally

Editor Types

A list of all editor types found in the Serenity Platform. If you know of any editor that is not listed here, feel free to update this page.

DateTimeEditor

Description

This editor is used to create a calendar style to pick a date that is then entered into a text box. It also uses a clock to the right side used to pick the time of entry.

Clock to the right side

Clicking on clock image, the editor sets current time

Set current time

Implementation

[BasedOnRow(typeof(Entities.OrderRow))]
public class OrderForm
{
   [DateTimeEditor]
   public DateTime OrderDate { get; set; }

Use DefaultValue("now") to set the current date time when add new record.

[BasedOnRow(typeof(Entities.OrderRow))]
public class OrderForm
{
   [DefaultValue("now"), DateTimeEditor]
   public DateTime OrderDate { get; set; }

Parameters

public class DateTimeEditorAttribute : CustomEditorAttribute
{
   public DateTimeEditorAttribute();

   public int EndHour { get; set; }
   public int IntervalMinutes { get; set; }
   public DateTime MaxValue { get; set; }
   public DateTime MinValue { get; set; }
   public bool SqlMinMax { get; set; }
   public int StartHour { get; set; }
}
  • MaxValue and MinValue appears to be invalid parameters for attribute_.

  • IntervalMinutes parameter sets the step among the proposed times. The default value is 5 minutes. For example, IntervalMinutes = 15

[DateTimeEditor(IntervalMinutes = 15)]

Interval Minutes

  • StartHour and EndHour seting the time at the beginning and end of the list. The parameter are integer.
[DateTimeEditor(StartHour = 12, EndHour = 15)]
  • SqlMinMax {To-Do}

TextAreaEditor

Description

This editor is used to create a description style text box used in entering descriptions.

Text area editor

Implementation

[BasedOnRow(typeof(Entities.OrderRow))]
public class OrderForm
{
   [TextAreaEditor(Cols = 1, Rows = 4)]
   public String ShipName { get; set; }

Parameters

public class TextAreaEditorAttribute : CustomEditorAttribute
{
   public TextAreaEditorAttribute();

   public int Cols { get; set; }
   public int Rows { get; set; }
}
  • Rows The parameter sets the height, in rows, of the text area control
  • Cols {To-Do}

HtmlContentEditor

Description

This editor is used to create a WYSIWYG in which content (text and graphics) onscreen during editing appears in a form closely corresponding to its appearance when printed or displayed as a finished product.

HTML content editor

Implementation

[BasedOnRow(typeof(Entities.OrderRow))]
public class OrderForm
{
   [HtmlContentEditor(Cols = 1, Rows = 4)]
   public String ShipName { get; set; }

Parameters

    public class HtmlContentEditorAttribute : CustomEditorAttribute
    {
        public HtmlContentEditorAttribute();

        public int Cols { get; set; }
        public int Rows { get; set; }
    }
  • Rows The parameter sets the height, in rows, of the HTML editor control
  • Cols {To-Do}