Question
· Feb 21, 2018

Change date format in table pane column filter

Hi

Is it possible to change the input format of the date filter for a zen tablepane component column when setting the filterType="date"? It only seems to accept odic format.

Cheers

Iain

Discussion (1)1
Log in or sign up to continue

To get this working I have implemented a customer filter
OnDrawFilter="DrawDateFilter" filterType="custom"

And created local versions of filterKeyPressed/filterChanged from %ZEN.Component.tablePane for validation

/// User override of filter for Title column.

Method DrawDateFilter(pTable As %ZEN.Component.tablePane, pName As %String, pColInfo As %ZEN.Auxiliary.column) As %Status
{
// check if manually entered or from date picker
if pColInfo.filterValue["/" {
set displayFilterValue=pColInfo.filterValue
} else {
set displayFilterValue=$select(pColInfo.filterValue'="":$zd($zdh(pColInfo.filterValue,3),4),1:"")
}
set src=pName
&html<<table class="tpFilterLayout" border="0" cellspacing="#(pTable.cellSpacing)#" width="100%"><tr>>
&html<<td nowrap="1"><input type="text" size="12" id="#(pTable.%MakeId("filter1_"_src))#" #(..%Attr("title",pColInfo.filterTitle))# class="tpFilterDate" value="#($ZCVT(displayFilterValue,"O","HTML"))#" onkeypress="zenPage.filterKeyPressed(event,'#(src)#','date',1);" onchange="zenPage.filterChanged('#(src)#',true,'date',1);"><input type="button" onclick="zenPage.getComponent(#(pTable.index)#).showDateSelector('#(src)#',1,'#(pColInfo.filterType)#','#(pColInfo.minDate)#','#(pColInfo.maxDate)#');" class="tpFilterButton" value="..."/></td>>
&html<</tr></table>>
Quit $$$OK
}