search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Control event text (numeric or alphanumeric)

Asked by Anonymous
1 month ago.

Hi,
Is it possible to prevent certain characters in the event text. I want the event text to contain all numeric values.
Thanks

1 other person also wants an answer.
Answer posted by Dan Letecky [DayPilot]
1 month ago.

The latest sandbox build (2020.4.4729) lets now includes an experimental onAfterEventEditRender event handler that lets you access the editing <textarea> element using args.element. You can use it to add custom event handler that will filter out the forbidden characters.

Comment posted by Anonymous
1 month ago.

Thank you. Now I want to change the style of the embedded textarea. I added the following CSS style both in the global style.css and in CSS file of the component that contains the scheduler.

.scheduler_time_reporting_board-place-editor {
border: 1px solid red !important;
}

onAfterEventEditRender: (args) => {
args.element.classList.add('scheduler_time_reporting_board-place-editor');
},

However it seems not work. Am I doing something wrong?

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Most browsers define an outline style that highlights the active input element. The border gets hidden by the outline. You need to override the outline style or hide the outline:

.scheduler_time_reporting_board-place-editor {
  border: 1px solid red !important;
  outline: none;
}
Comment posted by Anonymous
1 month ago.

Perfect! Thanks a lot!

New Reply
This reply is
Your name (optional):