I'm having problems with the DatePicker because by default it fills the created_from and created_until fields with the current date, so the list appears empty because these filters are applied.
I've seen that you can pass a default value to DatePicker and then the page will load with those values, but it will not accept the value null so it will always appear filtered by default.
I have consulted the current official documentation with the same use case and I can't get it to work as expected either.
:(
N
Nerijus
✓ Link copied!
What are you trying to achieve? Filters aren't set when you visit the page first time
D
d3lus10n
✓ Link copied!
It is just the opposite, when I visit the page for the first time it appears filtered with the date created_from and created_until with today's date, and as there is no record that matches those values the table appears empty until you click on the filters and reset them. I wonder why this happens, I have checked the code thoroughly and I can't get the created_from and created_until values to appear empty when loading the page for the first time.
Here is my code updated with the official documentation of the moment about this particular section:
For the moment, as a temporary solution, I am making it load with the records from the beginning of the year, so the list does not appear empty.
N
Nerijus
✓ Link copied!
Just added your filter into table and it works as expected. When I visit page first time all records are shown and when I select created_from only then filter is applied.
D
d3lus10n
✓ Link copied!
That code works because I set the default created_from value at the beginning of the year, if you remove the default method from the DatePicker does it work the same?
N
Nerijus
✓ Link copied!
Sorry, forgot to mention, I removed the default from your filter code.
I'm having problems with the
DatePickerbecause by default it fills thecreated_fromandcreated_untilfields with the current date, so the list appears empty because these filters are applied.I've seen that you can pass a default value to
DatePickerand then the page will load with those values, but it will not accept the valuenullso it will always appear filtered by default.I have consulted the current official documentation with the same use case and I can't get it to work as expected either.
:(
What are you trying to achieve? Filters aren't set when you visit the page first time
It is just the opposite, when I visit the page for the first time it appears filtered with the date
created_fromandcreated_untilwith today's date, and as there is no record that matches those values the table appears empty until you click on the filters and reset them. I wonder why this happens, I have checked the code thoroughly and I can't get thecreated_fromandcreated_untilvalues to appear empty when loading the page for the first time.Here is my code updated with the official documentation of the moment about this particular section:
For the moment, as a temporary solution, I am making it load with the records from the beginning of the year, so the list does not appear empty.
Just added your filter into table and it works as expected. When I visit page first time all records are shown and when I select
created_fromonly then filter is applied.That code works because I set the default
created_fromvalue at the beginning of the year, if you remove thedefaultmethod from theDatePickerdoes it work the same?Sorry, forgot to mention, I removed the default from your filter code.