2

I am trying to filter a table using a DateBox. The problem I have is that it doesn't display the records of that day when binding value is set to @datasource.query.filters.date._equals. However, it does work when the filter is _greaterThanOrEquals, but it also includes later records.

I am using SQL tables with date field type is DATE.


enter image description here


enter image description here

XY6
  • 3,082
  • 4
  • 21
  • 26

2 Answers2

1

It's a bug. We're looking into it.

For now please use workaround: Remove the binding and set 2 filters in onValueEdit event with code like:

widget.datasource.query.filters.FIELD_NAME._greaterThanOrEquals = newValue;
widget.datasource.query.filters.FIELD_NAME._lessThanOrEquals = newValue ? new Date(newValue.getTime() + 24*60*60*1000) : null;
widget.datasource.load();
Vasyl Petrushko
  • 366
  • 2
  • 3
0

bind DateBox value to

@datasource.query.filters.NameOfDateFiled._equals

and don't forget reload datasource in "onValueChange" event.

Andrey Koltsov
  • 1,956
  • 6
  • 24
  • 43
  • That's exactly what I am doing. – XY6 Jun 30 '17 at 14:31
  • It doesn't work unless a LessThan/GreaterThan/OrEquals is used. – XY6 Jun 30 '17 at 14:47
  • just tried @datasource.query.filters.Date._lessThanOrEquals and it works, don't forget to readload datasource in "onValueChange" event. – Andrey Koltsov Jun 30 '17 at 14:51
  • That's what I am saying. It does work with _lessThanOrEquals _greaterThanOrEquals, etc... However, not with _equals. I am reloading the datasource. – XY6 Jun 30 '17 at 14:54