Always include date sub-template, and just disable it when not needed.

Fixes date widgets not validated.
This commit is contained in:
Nathan Gray 2014-08-25 17:29:42 +00:00
parent 60b02ccb4b
commit 300263e534
2 changed files with 14 additions and 3 deletions

View File

@ -115,22 +115,33 @@ app.classes.infolog = AppJS.extend(
},
/**
* Enable or disable the date filter
*
* If the filter is set to something that needs dates, we enable the
* header_left template. Otherwise, it is disabled.
*/
filter_change: function()
{
var filter = this.et2.getWidgetById('filter');
var nm = this.et2.getWidgetById('nm');
var dates = this.et2.getWidgetById('infolog.index.dates');
if(nm && filter)
{
switch(filter.getValue())
{
case 'bydate':
case 'duedate':
nm.set_header_left('infolog.index.dates');
if (filter && dates)
{
dates.set_disabled(false);
}
break;
default:
nm.set_header_left();
if (dates)
{
dates.set_disabled(true);
}
break;
}
}

View File

@ -163,7 +163,7 @@
<template id="header_right"/>
</row>
<row>
<nextmatch id="nm" template="infolog.index.rows" span="all"/>
<nextmatch id="nm" template="infolog.index.rows" header_left="infolog.index.dates" span="all"/>
</row>
<row>
<hbox class=" ">