Announcement

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

    FilterBuilder RelativeDateItem using DateTimes instead of Date

    Note: Everything about this post is all based on the idea that we are only using the SmartClient JavaScript library.

    So I am going to word this the best way that I can. We are using a FilterBuilder to do some complex filtering of the data in our app. My question is quite simple though, how can I make the RelativeDateItem use the date picker, rather than the DateTime picker when the field is of type date or datetime?

    I have gotten as far as trying to override the getEditorType(field, operatorId) function, and just return RelativeDateItem when the type of the field is either date or datetime. This still makes the date picker (when clicking on the calendar icon, for hard-coded dates) show up with the time on it as well. The issue is that all this method returns is a string name of the Class that the editor should be created with, and I have no access to actually change the properties of the editor.

    It is almost as if there should be a RelateiveDateItem, AND a RelativeDateTime item... but it does not seem that this is the case.

    Also, please note that a DateItem will not work for us, as the relative dates are used much more often than the hard-coded dates.

    I believe that we are on version 10.0 - release date of 12/2/15.

    Thanks in advance for any help!

    #2
    RelativeDateItem will show an interface for editing datetimes if the type property is set to "datetime", or just dates if the type is set to "date".

    When you are using a FilterBuilder, the type of the DataSource field is used, so this is generally just automatic.

    You don't seem to have a reason to actually use this API, but an override of getValueFieldProperties() is the way that you can apply properties to editors. A getEditorType() override would also work if you had defined a class with whatever properties you want to set as defaults for that class.

    Comment


      #3
      Thanks for the quick reply. You cleared the path for me and I have implemented the changes.

      Comment

      Working...
      X