Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Duration Field Component

    I want to create a custom form item component to support a duration field.
    I have looked through all the form items and the RelativeDateItem component is the closest to what I need but the key difference is that the field stores a duration and not a relative date value but also need the hours/minutes/seconds as shown below.
    The duration is stored as an "Interval" field in the database in ISO 8601 format: P(n)Y(n)M(n)DT(n)H(n)M(n)S
    the desired component would look like this:
    Click image for larger version  Name:	DurationComponent.png Views:	0 Size:	14.9 KB ID:	264597
    I have looked at the example for custom components but the example seems quite different to what I would like to do:
    https://www.smartclient.com/smartcli...customFormItem

    If someone has implemented a custom component and can provide pointers to the best way to go about this so that it is integrated into the SmartClient framework and inherits all the appropriate styling, events etc it would be very much appreciated.
    Last edited by chris@umed.io; 9 Feb 2021, 05:06.

    #2
    You probably want to use CanvasItem (sample), where the Canvas is a DynamicForm that looks however you want your duration editor to look. Then put together the ISO 8601 format as a string - that's the value - and of course be ready to parse an existing ISO 8601 duration and populate your form.

    Comment


      #3
      Thank you.

      Comment

      Working...
      X