Announcement

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

    ListGrid and FilterEditor

    Hi Isomorphic,

    I would like to know if there is a way to filter on a DateTime column from a ListGrid using the FilterEditor but this only by date.

    I try to configure the MiniDataTimeRange, but I do not find a way to specify that the value entered must be only a date.

    Code:
     
    MiniDateRangeItem dateRangeItem = new MiniDateRangeItem();
    list.getField("DATETIME").setFilterEditorProperties(dateRangeItem);
    I saw there is some method in the MiniDateRangeItem to set the format.
    The method setDateDisplayFormat(DateDisplayFormat dateDisplayFormat) allow to define the format, but only specify one coming from the enum DateDisplayFormat.
    The same thing for method setDateFormatter(DateDisplayFormat dateFormatter)

    Code:
    MiniDateRangeItem dateRangeItem = new MiniDateRangeItem();
    dateRangeItem.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    dateRangeItem.setDateDisplayFormat(DateDisplayFormat.TOEUROPEANSHORTDATE);	
    list.getField(DSOperator.LAST_LOGIN).setFilterEditorProperties(dateRangeItem);
    I would like to know too if there is a way to avoid, when using the calendar pick up, the display of the select item for hours and minutes.

    For the filter builder for this list grid I found a way to do this with a RelativeDateItem

    Code:
    RelativeDateItem item = new RelativeDateItem();
    item.setDateFormatter(new DateDisplayFormatter() {
    	
    	@Override
    	public String format(Date date) {
    		return Localization.formatDate(date);
    	}
    });
    TimeItem timeItem = new TimeItem();
    timeItem.setShowHourItem(false);
    timeItem.setShowMinuteItem(false);
    timeItem.setShowSecondItem(false);
    timeItem.setShowMillisecondItem(false);
    item.setPickerTimeItemProperties(timeItem);
    
    dataSourceField.setEditorProperties(item);
    Can you help me with that?

    Thanks

    Julien

    #2
    Why do this? It cripples built-in functionality that allows the user to do much more. The existing functionality already allows the user to easily select a particular date that they want to filter by.

    Comment


      #3
      Yes of course.
      But this is a need.
      Or maybe can you explain me, how to set the second the pickup calendar of a MiniDateRangeItem?

      Comment


        #4
        None of these attempts is actually achieving what you think you're achieving - you are suppressing the *display* of time information, but all of the logic is still working in terms of datetime values, not date values.

        Could you explain more clearly what you want - do you want things to behave exactly as though the field were really a date, and not a datetime? Or do you want some kind of behavior in between?

        Just to emphasize again: this is downgrading the default behavior of the component, and it's going to be at least moderately complicated to achieve. If you have someone on your user experience team asking for this, it's important to go back to them and point out that they are actually downgrading the default behavior, in case this is just a miscommunication that will cause you extra work while worsening the UI.

        Comment

        Working...
        X