Failed to execute 'closest' on 'Element': '.' is not a valid selector.

Hi,

When using the Scheduler (v 18.1.0.59) we see the following error in the console

"Failed to execute 'closest' on 'Element': '.' is not a valid selector."  Which prevents the ActionCompleted event from being fired and any updates we make to the entry are not saved



31 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team October 26, 2020 02:34 PM UTC

Hi Alex, 

Greetings from Syncfusion support. 

We have validated your reported query at our end. But, we are unable to reproduce the issue at our end. We have prepared a sample for your reference and it can be available below. 


Kindly try the above sample and if you still facing the same problem please share the below details to serve you better. 

  • Schedule rendering code with video demo that illustrates the issue or
  • Reproduce the issue in the above-shared sample or
  • Share the sample that illustrates the issue(if possible) which would help us to proceed further.

Regards, 
Ravikumar Venkatesan 



AL Alex October 28, 2020 05:55 PM UTC

Thanks for getting back to me.

This is the standard Scheduler control setup so we don't experience any issues either using your sample, however our application is more complicated than this so it's not really  comparable or helping us.  As we have been able to capture the error message, there is obviously an issue.

To explain more our SfSchedule control includes two SfDropDownLists and we need to be able to populate these with options based on a value and then set the correct value for these two SfDropDownLists.  However, when we capture the onclick event to populate the dropdownLists and then call

await SfSchedule.OpenEditor(eventData, CurrentAction.EditOccurrence); 

we get this



We just need a way to populate the dropdown lists before setting their value, we tried using OnPopupOpen but although the dropdownlists get populated the value is never set.  Here is the code we are using with the EditorTemplate



and here is the OnPopupOpen code

public async Task OnPopupOpen(PopupOpenEventArgs args)
        {
            if (args.Type == PopupType.QuickInfo)
            {
                args.Cancel = true;
            }
            else
            {
                CaseReference = args.Data.CaseReference;

                if (CaseReference != null)
                {
                    Stages = await sageService.GetStagesAsync(CaseReference);
                    BookingTypes = await sageService.GetBookingTypesAsync(CaseReference);
                }
                else
                {
                    Stages = new List();
                    BookingTypes = new List();
                }
            }
        }



Thanks,
Alex







AL Alex October 28, 2020 09:27 PM UTC

We are now able to recreate, the console error displayed happens when updating an existing entry




NR Nevitha Ravi Syncfusion Team October 29, 2020 11:07 AM UTC

Hi Alex, 

Thanks for your update. 

We have validated the reported problem at our end and found the cause for the reported issue, you have missed to define ‘e-field’ class which is mandatory for each field defined within editor template to process the field values internally in the mentioned version 18.1.59. Though in our latest version we don’t need to maintain ‘e-field’ class. So we suggest you to either upgrade the version or add ‘e-field’ class in your SfDropDownList and each fields in template. 

Please refer the following UG for editor template used in latest version. 

Regards, 
Nevitha 



AL Alex November 3, 2020 01:22 PM UTC

Hi, we tried adding the css and that still didn't work.

We've moved to the latest version and following this example

https://blazor.syncfusion.com/documentation/scheduler/editor-template/#how-to-add-resource-options-within-editor-template

However, the example doesn't seem to work as the owner names are not displaying.





This issue is becoming a major embarrasement to us as it's work we've done on behalf of our client so grateful for any help.

Alex



RV Ravikumar Venkatesan Syncfusion Team November 4, 2020 03:25 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported query at our end. We have resolved your reported problem by the below-highlighted change. We have prepared a sample for your reference and it can be available below. 


[Index.razor] 
<SfDropDownList TValue="int" TItem="ResourceData" ID="OwnerId" DataSource="@OwnersData" Placeholder="Choose owner" @bind-Value="@((context as AppointmentData).OwnerId)"> 
    <DropDownListFieldSettings Text="OwnerText" Value="Id"></DropDownListFieldSettings> 
</SfDropDownList> 

Currently, we are facing issues with the EditorTemplate when performing save action with resources and for that, we have logged the below defect report at our end. The fix will be included in our weekly patch release scheduled on November 25, 2020. We would appreciate your patience until then. You can track this bug using the below feedback link. 


Please let us know if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 



AL Alex November 4, 2020 05:56 PM UTC

Hi,

Thanks for the response and sample.

We've been able to pin point the issue with Scheduler.  When we include an AutoComplete control within the EditorTemplate the error message ""Failed to execute 'closest' on 'Element': '.' is not a valid selector."" is always displayed and we have included CssClass="e-field"

This is using v 18.1.43. Could you confirm this your side?

When we remove the AutoComplete control we get the following error but the entry is saved



Thanks,
Alex


AL Alex November 4, 2020 06:26 PM UTC

Actually when we removed the auto complete, we still have an issue if we add a timesheet entry and then update.  If we add a timesheet entry and then refresh the page we don't get the issue,




RV Ravikumar Venkatesan Syncfusion Team November 5, 2020 07:45 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported query at our end. We suspect that you are not added HtmlAttributes property to one of the fields(Maybe Numeric textbox) used in your editor template. Make sure the HtmlAttributes property is added to the required fields. We have prepared a sample for your reference and it can be available below. 

The HtmlAttributes property needs to add as shown in the below code. 

[Index.razor] 
        <EditorTemplate> 
            <table class="custom-event-editor" width="100%" cellpadding="5"> 
                <tbody> 
                    <tr> 
                        <td> 
                            Billing Rate 
                        </td> 
                        <td> 
                            <SfNumericTextBox TValue="double?" HtmlAttributes="@BillingValue" CssClass="e-field" Value=@((context as AppointmentData).BillingAmount)></SfNumericTextBox> 
                        </td> 
                    </tr> 
                </tbody> 
            </table> 
        </EditorTemplate> 
 
@code{ 
    Dictionary<string, object> BillingValue = new Dictionary<string, object>() 
{ 
        {"data-name","BillingAmount"}, 
    }; 
 
} 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 



AW Alex Whittle November 6, 2020 04:45 PM UTC

Hi,

We tried adding html attributes still no difference.  This is now causing us to lose the faith of our client and jeopardising any future work.  

Would appreciate it if you could give this your urgent attention.

Alex


RV Ravikumar Venkatesan Syncfusion Team November 9, 2020 12:47 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported problem at our end. But, we are unable to reproduce the reported problem at our end. Please share the below details to serve you better. 

  • Schedule EditorTemplate related code or
  • Reproduce the reported problem in our previously shared sample and share it with us or
  • Share a sample that illustrates the problem which would help us to proceed further.

Regards, 
Ravikumar Venkatesan 



AL Alex November 11, 2020 07:44 AM UTC


I've added some setup instructions: and a new zip file

1.  Uncomment lines 131 - 135 in startup.cs of Accord.Web.  This will seed and create a local database (check the connection string is pointing to local db)
2.  move to https://localhost:44347/Identity/Account/register and create an Admin user
3.  From the menu select Users - -- Add User
4.  Sign out as an Admin
5.  Sign in as the user created in step 3
6.  From the menu select Timesheets and try and add a new Timesheet entry and then update after a few attempts the console 
will display the error

We need help on this ASAP.

Attachment: Accord.Web_8ef0a456.zip


RV Ravikumar Venkatesan Syncfusion Team November 11, 2020 04:29 PM UTC

Hi Alex, 
  
Thanks for the update. 
  
We have tried to run your sample based on your shared steps. In your shared sample a reference project Accord.Test.Data.csproj is unavailable. So, we have modified the code related to it to run the sample. After that, we are able to run your sample. But, when navigating to the timesheet page. It throws a script error. We have recorded this as a video demo which can be available below. We have entered the employee number as “1234” when creating the new user. Could you please share what we are doing wrong or how to resolve the problem we are facing when running your sample? If there is a problem in the sample end please share a runnable sample or replicate the issue in our previously shared sample. 
  
  
Regards, 
Ravikumar Venkatesan


AL Alex November 11, 2020 06:25 PM UTC

Hi, thanks for getting back to me.

Apologies I forgot to add the employee number should be "ACD".  If you need anything else please let me know.

Thanks,
Alex


RV Ravikumar Venkatesan Syncfusion Team November 12, 2020 04:00 PM UTC

Hi Alex, 
  
Thanks for the update. 
  
We have checked your reported problem at our end. We have checked your reported problems in versions v18.1.0.43 and v18.1.0.59. But, we are unable to reproduce the problem “Failed to execute 'closest' on 'Element': '.' is not a valid selector” when performing both save and edit actions. In the v18.1.0.59 we are not facing any issues with your shared sample. So, we suggest you to upgrade your packages to v18.1.0.59 or the latest version(v18.3.0.48) of Syncfusion.Blazor package and we have prepared a video demo and your shared sample for your reference and it can be available below. 
  
  
Kindly try the above sample and video demo and let us know if you need any further assistance. 
  
Regards, 
Ravikumar Venkatesan 



AL Alex November 12, 2020 06:36 PM UTC

Hi,

I've watched the video, you need to add Case, Stage and Booking type and the other fields.  This is getting ridiculous, this issue has been open for nearly 3 weeks.  As mentioned above I asked you to get in touch if you needed any further help to reproduce the issue.

We can produce every time - just complete all the fields and save.  Click to edit and then save again and you get the error below which prevents ActionCompleted from completing so impossible to save an Entry.


I'm available now to help.

Alex


AL Alex November 12, 2020 09:41 PM UTC

I've downloaded "my sample" which works?  But after updating the local version we have to 18.1.59 our version doesn't work.  Can you explain what else you changed so we can add to our existing code.

Thanks!


AL Alex November 12, 2020 11:00 PM UTC

Doesn't work when refreshing the page.

Save an entry
Refresh page
edit entry and then save
you'll get the error

Sample uploaded.

Attachment: Accord.Web_dbed8d68.zip


AL Alex November 13, 2020 03:56 PM UTC

Please look at this thoroughly today, we've wasted weeks on this one issue.  Every other day you've had a quick look without recreating the issue/ 

It clearly doesn't work as you can see from the screenshots and demos provided.  I'm guessing the error message is familiar to you.


RV Ravikumar Venkatesan Syncfusion Team November 16, 2020 01:53 PM UTC

Hi Alex, 

Thanks for the patience. 

We have validated your reported problem at our end and could reproduce the problem with your shared replication steps. So, we have checked the reported problem with the latest version(v18.3.0.48) of Syncfusion.Blazor package and it works fine at our end. So, we have modified your sample with the latest version of Syncfusion.Blazor package and made the required breaking changes in all Syncfusion Blazor components used in it. The sample with the latest version of Syncfusion.Blazor package is available below and we suggest you to upgrade Syncfucion.Blazor packages to the latest version in your project. Refer to the below release notes link for the breaking changes.  


Kindly try the above sample and let us know if you need any further assistance. 

Note: We suggest you clear the Nuget cache in your machine before running the sample. 

Regards, 
Ravikumar Venkatesan 


Marked as answer

AL Alex November 17, 2020 09:58 PM UTC

Hi,

Thanks for the response and sample much appreciated.

Regards,
Alex


NR Nevitha Ravi Syncfusion Team November 18, 2020 05:32 AM UTC

Hi Alex, 

You are most welcome 😊, please get back to us if you need any further assistance. 

Regards, 
Nevitha 



AL Alex November 18, 2020 05:35 PM UTC

Unfortunately, it still doesn't work.

Create an entry and save, refresh the page and edit and the Stage and BookingType are missing.



AL Alex November 18, 2020 05:54 PM UTC

The Scheduler control seems to have gone backwards in the latest release, very slow and glitchy.  This is getting even more embarrassing for us, we've decided to use Syncfusion controls for a client project and the Scheduler is just not working properly.  




RV Ravikumar Venkatesan Syncfusion Team November 19, 2020 04:35 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported query at our end. We have resolved your reported problem with the help of the code shown below. We have prepared a sample for your reference which can be available below. 

[Timesheets.razor.cs] 
namespace Accord.Web.Pages 
{ 
    public partial class Timesheets 
    { 
        public string stageVal; 
        public string bookingTypeVal; 
        public int count = 0; 
 
        public async Task OnPopupOpen(PopupOpenEventArgs<Entry> args) 
        { 
            if (args.Type == PopupType.QuickInfo) 
            { 
                args.Cancel = true; 
            } 
            else 
            { 
                if(count == 1) 
                { 
                    args.Data.Stage = stageVal; 
                    args.Data.BookingType = bookingTypeVal; 
                    stageVal = null; 
                    bookingTypeVal = null; 
                    count = 0; 
                     
                } 
                else 
                { 
                    stageVal = args.Data.Stage; 
                    bookingTypeVal = args.Data.BookingType; 
                    count++; 
                } 
            } 
        } 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 



AL Alex November 21, 2020 12:10 PM UTC

Unfortunately this has made the problem worse!  Now the case is also missing, not just stage and booking type.  Add an entry and save.  Refresh page and all dropdowns are now empty.





RV Ravikumar Venkatesan Syncfusion Team November 23, 2020 07:35 AM UTC

Hi Alex, 

Thanks for the update. 

We have checked your reported problem in our previously shared sample. But, it works fine at our end, we have prepared a video demo for your reference which can be available below. Could you please check the sample that we have shared previously? 


Kindly check the above video demo and if you still facing the same problem please share a sample that illustrates the problem with the issue replicating video it helps us to check the reported case further at our end. 

Regards, 
Ravikumar Venkatesan 



AL Alex November 24, 2020 08:18 AM UTC

Hi,

We are using your sample.  Add an entry and press F5 to refresh the page, it doesn't work.


RV Ravikumar Venkatesan Syncfusion Team November 25, 2020 07:00 AM UTC

Hi Alex, 

Thanks for the update. 

We have checked the problem that you have reported based on your shared steps. But, we are unable to reproduce the problem that you have reported. We have prepared a video demo for your reference which can be available below. Could you please clear the Browser and Nuget cache in your machine and check the problem again? 


Kindly check the above video demo and if you still facing the same problem please share the below details to serve you better. 

  • What we are doing wrong in your shared steps in our shared video demo or
  • Share a video demo that illustrates the problem with the issue replicating sample which would help us to proceed further.

Regards, 
Ravikumar Venkatesan 



AL Alex December 1, 2020 03:46 PM UTC

We've checked the video but you're not setting all the values - this is getting absolutely ridiculous.  Our client is no longer willing to pay for the work we've done as the scheduler control is so flaky.  We get this error whenever we now try to update an entry.  What does the error message relate to?




RV Ravikumar Venkatesan Syncfusion Team December 2, 2020 01:50 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported query at our end. But, we are unable to reproduce the reported problem at our end after filling all the fields of the editor window. So, we have prepared a video demo for your reference and it can be available below. We suspect that you are using the older version of the Syncfusion packages. So, we suggest you to upgrade the Syncfusion.Blazor package version to the latest version and we have prepared a sample with the latest version of Syncfusion.Blazor sample and which can be available below. 


Kindly check the above video demo and sample and get back to us for further assistance. 

Regards, 
Ravikumar Venkatesan 


Loader.
Up arrow icon