Welcome, Guest
Username: Password: Remember me

TOPIC: Calendar Picker (FIlter) and GRID ORDERING

Calendar Picker (FIlter) and GRID ORDERING 17 Aug 2017 09:38 #15271

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
1) When I do a build with 3.1.9 (Latest) The calendar picker in the filter is doing nothing on my project, so I ran it in SANDBOX (project DELAYREPORTING)

On sandbox the calendar (front end) does not work either, console shows this

date-helper.min.js:1 Uncaught TypeError: Cannot read property '0' of null
at Function.a.parseFieldDate (date-helper.min.js:1)
at c.checkInputs (calendar.min.js:1)
at c.show (calendar.min.js:1)
at HTMLInputElement.<anonymous> (calendar.min.js:1)

When you select any date, the search box just fills with d-m-y

If I build with 3.1.5, the calendar picker in filters works fine

2) If I do a build with 3.1.5 or above and set fields on my grid to be ordering, NO ordering works, at all. This is confirmed in SANDBOX

If I build with 3.0.10, all ordering works fine
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Calendar Picker (FIlter) and GRID ORDERING 06 Oct 2017 18:37 #15351

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
I have the same issue with the calendar
Last Edit: 06 Oct 2017 18:38 by Romkabouter.
The administrator has disabled public write access.

Calendar Picker (FIlter) and GRID ORDERING 07 Oct 2017 14:30 #15352

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
I have a workaround which works in my case, the problems seems to be that the field used as filter holds:
		<field name="filter_creation_date_from"
				placeholder="XPLOG_FILTER_CREATION_DATE_CREATION_DATE_FROM"
				type="calendar"
				submit="true"
				format="Y-m-d H:i:s"
				label="XPLOG_JSEARCH_CREATION_DATE"
				class="element-filter input-small"
				ui="chosen"/>
This is a date field in a form:
		<field name="creation_date"
				alias="creation_date"
				label="XPLOG_FIELD_CREATION_DATE"
				filter="USER_UTC"
				type="calendar"
				format="%Y-%m-%d %H:%M:%S"
				todaybutton="true"
				weeknumbers="false"
				filltable="true"
				singleheader="false"
				minyear="-100"
				maxyear="+50"
				timeformat="24"/>
notice the format="Y-m-d H:i:s", this differs from the field used in a form: format="%Y-%m-%d %H:%M:%S"

So what I did was fork the xml (below is the whole xml file, put in fork/model/form/yourtable.xml) and put the following code in it, to override the filter field:
<?xml version="1.0" encoding="utf-8"?>
<form>
	<fieldset name="default.filters" addfieldpath="/administrator/components/com_xplog/fork/models/fields">
		<field name="filter_creation_date_from"
				placeholder="XPLOG_FILTER_CREATION_DATE_CREATION_DATE_FROM"
				type="calendar"
				submit="true"
				format="%Y-%m-%d %H:%M:%S"
				label="XPLOG_JSEARCH_CREATION_DATE"
				class="element-filter input-small"
				ui="chosen"/>
	</fieldset>
</form>

And that fixes the issue in my case, but I think the cause is the incorrect generating of the filter fields in the xml
The administrator has disabled public write access.
The following user(s) said Thank You: MorganL

Calendar Picker (FIlter) and GRID ORDERING 09 Oct 2017 11:05 #15353

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
I will check that this morning
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Calendar Picker (FIlter) and GRID ORDERING 09 Oct 2017 11:40 #15354

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
There is a bug in facts.
I've been digging it this W-E, and this is just a formating problem.

In facts, there is 2 formats for the dates.
Joomla tends to use the format of DateTime php class. (without %)
Calendar picker is using the php strftime format (with %)
Both are interresting, but lets prefer the DateTime format for Joomla and for Cook.

JDom was handling the format conversion for the very basic keyworks
Now, I've been realising how messy is the DateHelper in your components, and I decided to rewrite it a bit.

I also encounted problems with UTC management.
It works in the forms because it is nicely handled by Jooomla, but for the filters, it does not work yet because my XML filters has been invented before that Joomla finally do it. At the end cook component are not respecting the new filters XML declaration. I can explain better if you ask.

I am gonna fix your issue, but truly speaking, I am sure that Joomla calendar field will be changed in future. In fact, can someone explain me why it do not accept the DateTime format ?

So I am writting formats conversions functions in the date helper, and also deprecating few things.
Tell you more in the day

This will be properly handled in version 3.2, but this step version is long and complex to achieve. (Fields / Filters / Layouts / JDomless... to native standard)
Coding is now a piece of cake
Last Edit: 09 Oct 2017 11:43 by admin.
The administrator has disabled public write access.

Calendar Picker (FIlter) and GRID ORDERING 11 Oct 2017 14:00 #15364

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Using Romkabouter's fix, I can get the calendar picker working HOWEVER

2) If I do a build with 3.1.5 or above and set fields on my grid to be ordering, NO ordering works, at all. This is confirmed in SANDBOX

s still the case. I have experted with latest stable, and grid ordering just does not work (vanilla, no forks)
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Calendar Picker (FIlter) and GRID ORDERING 11 Oct 2017 14:46 #15365

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
That's strange, work fine on my builds.
I'll have to leave that one for admin then
The administrator has disabled public write access.
Time to create page: 0.121 seconds

Get Started