UI Events: Configuration of Relative Dates in a Column with Matrix Mode
If a column of a table is in matrix mode, you can specify values of different types by using the fullState property of the columnConfig decorator.
However, to specify that a user can enter relative dates in the cell—that is, values such as @Today or @WeekStart—you need to implement the RowSelected event handler. In the event handler, you call the PXDatetimeFieldState.showRelativeDates method to indicate that the values are allowed.
An example of such a handler is shown in the following code.
@handleEvent(CustomEventType.RowSelected, { view: "Rules" })
onEPRuleConditionSelected(
args: RowSelectedHandlerArgs<PXViewCollection<EPRuleCondition>>)
{
const ar = args.viewModel.activeRow;
ar.Value?.to(PXDatetimeFieldState).showRelativeDates();
}