We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use Autocomplete inside EventEditorTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

143745 Apr 3,2019 05:32 PM UTC Apr 11,2019 03:40 AM UTC JavaScript - EJ 2 3
loading
Tags: Schedule
S_Line
Asked On April 3, 2019 05:32 PM UTC

Hi,
I want to use a autocomplete in a textbox inside a eventeditortemplate. When i configure it, the first time i open the editor, by double click on cell, it work fine, but, if i click to open it again, i got the error in console "Failed to execute 'closest' on 'Element': '.' is not a valid selector.".

Can you help me?

Thank you.

Nevitha Ravi [Syncfusion]
Replied On April 4, 2019 05:32 AM UTC

Dear Customer, 

Greetings from Syncfusion Support. 

We suspect that autocomplete control is not rendered properly which might throw the reported script error. Kindly refer the following sample link in which autocomplete works fine within editor template. 

        editorTemplate: '#EventEditorTemplate', 
        popupOpen: function (args) { 
            if (args.type === 'Editor') { 
                var statusElement = args.element.querySelector('#EventType'); 
                if (!statusElement.classList.contains('e-autocomplete')) { 
                  var autoCompleteObject = new ej.dropdowns.AutoComplete({ 
                        placeholder: 'Select a status', value: statusElement.value, 
                        dataSource: ['New', 'Requested', 'Confirmed'] 
                    }); 
                    autoCompleteObject.appendTo(statusElement); 
                    statusElement.setAttribute('name', 'EventType'); 
                } 
              

Please check the sample if you still face the problem revert us back with your code or else try to reproduce it in the above sample. 

Regards, 
Nevitha 


S_Line
Replied On April 10, 2019 11:54 AM UTC

Thank you! It working fine now!


Karthigeyan Krishnamurthi [Syncfusion]
Replied On April 11, 2019 03:40 AM UTC

Dear Customer,  
 
We are happy that our solution resolved your issue. 
 
Regards, 
Karthi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon