Discuss anything related to web development but no technical support questions


Post by pradeepal »

Hi Team,

I’m using SchedulerPro v6.3.4 in an Angular project. In the TaskEdit modal, there’s a dropdown field that currently triggers ValidateFilter. I’d like to prevent this validation from firing for this specific field.

Could you advise on the best approach to disable or bypass ValidateFilter in this context?

Thanks in advance for your help!


Post by tasnim »

Hi there,

I need a bit more info to give a precise answer, which dropdown field/ref in the TaskEdit editor (e.g. resourcesField, a custom combo) is triggering ValidateFilter, and can you paste the TaskEdit config or the console call stack showing ValidateFilter?

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by pradeepal »

Hi Tasnim,

This is a custom dropdown field, and the unnecessary validation only started appearing after we upgraded @bryntum/schedulerpro from 6.2.3 to 6.3.4.

Below is the relevant TaskEdit configuration for the dropdown field (contactPersonList):

contactPersonList: {
              type: 'dropdown',
              name: 'contactPerson',
              label: this.translate.instant(TextKey.Edit.ContactPerson),
              weight: 500,
              picker: {
                itemTpl: (item: { data: Contact }): string => `${item.data.text} ${item.data.isMainContact ? '<default-contact-person />' : ''}`,
                onBeforeItem: (item: { record: { data: Contact } }): boolean => !!item.record.data.mobile,
                cls: 'contact-person-list'
              },
              listeners: {
                change: (eventData: any): void => {
                  const { reminderLeadHourList, messageTemplateTextfield, messageTemplateDropdown, startDateField, contactPersonList, workOrderList } =
                    eventData.source._parent._widgetMap;
                  const selectedContactPerson: number = eventData.value;
                  const record = eventData?.source?._parent?._record;

              record?.set('contactPerson', selectedContactPerson);

              this.updateReminderLeadHours(eventData);
              if (!selectedContactPerson) {
                reminderLeadHourList.setValue('0');
                record?.set('reminderLeadHour', 0);
              } else {
                if (messageTemplateDropdown.value === this.translate.instant(TextKey.Planner.Edit.Default)) {
                  const assignment = this.assignments.find((assignment) => assignment.assignmentId === workOrderList.value) as Assignment;
                  this.setDefaultNotificationMessage(eventData, messageTemplateTextfield, startDateField, contactPersonList, assignment);
                }
              }

              reminderLeadHourList.disabled = !(Number(selectedContactPerson) > 0);
            },
            action: (eventData: any): void => {
              const { notifyMessageToggle } = eventData.source._parent._widgetMap;
              const record = eventData?.source?._parent?._record;
              notifyMessageToggle.disabled = GeneralUtils.isNullOrUndefined(eventData.value);
              if (GeneralUtils.isNullOrUndefined(eventData.value)) {
                notifyMessageToggle.checked = false;
                record?.set({
                  onCreateActive: false,
                  onCreateMessage: ''
                });
              }
            }
          }
        },

Post by alex.l »

Hi pradeepal,

So you're saying you have validation for custom field you just added yourself? We do not have any code that might make invalid the field we did not have. Unfortunately, your code snippet cannot be used in runnable app. Any chance to get runnable code we can debug to see this problem?

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy


Post Reply