Announcement

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

    Only allow relative dates in RelativeDateItem

    SmartClient Version: v10.0p_2015-12-02/Pro Deployment (built 2015-12-02)

    I am wondering if it is possible to make a relative date item ONLY allow relative dates to be entered....or in other words, not allow the user to click on the little calendar icon to put in a "hard-coded" date. I am aware that I can work around this with some custom stuff, but I am just wondering if there is already something created for this purpose. No sense in re-inventing the wheel.

    Essentially we don't want users to put in hard-coded dates because they tend to then forget that they did so.... so we only want to allow them to set relative dates. Long story short, they are setting up start/end date parameters for scheduled tasks and we don't want them to enter something like "1/1/2017", we ONLY want them to put "First day of the year" or something to that effect. Don't get me wrong - I know how to make custom relative dates... I am asking if there is anything that denies the user from using hard-coded dates.

    If not, a-okay, just figured I would ask. Thanks in advance.

    #2
    Yes, you can do it via the AutoChild system:

    Code:
    isc.DynamicForm.create({
        items: [
            {
                name: "rdi", editorType: "RelativeDateItem",
                // don't allow absolute dates to be selected with the DateChooser
                showChooserIcon: false,
                // switch to SelectItem for the valueField - SelectItem's don't allow text-entry
                valueFieldProperties: { editorType: "SelectItem" }
            }
        ]
    });
    We'll add a public attribute to do this automatically in 11.1.
    Last edited by Isomorphic; 2 Mar 2017, 04:07.

    Comment


      #3
      This worked perfectly. Thank you for the quick and helpful reply.

      Comment

      Working...
      X