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. Image for the cookie policy date

Autocomplete Component in Custom Editor Template

I am having an issue using the Autocomplete component inside an editor template for the Scheduler Component. Its my understanding that all "input" fields in the editor template must have className="e-field". However passing this into the Autocomplete Component inside the editor template causes an error, message: 'Uncaught DOMException: Failed to execute 'closest' on 'Element': '.' is not a valid selector'

If className is not passed through, no error is thrown the event is not updated. Please could you advise on how to get the Autocomplete component working with a custom editor template in the scheduler


6 Replies

MA Matthew July 31, 2019 02:17 PM UTC

See attached for example snippet to reproduce 

Attachment: editor_template_autocomplete_45804cc7.zip


KK Karthigeyan Krishnamurthi Syncfusion Team August 1, 2019 09:44 AM UTC

Hi Matthew 
 
Syncfusion greetings. 
 
We provided the e-field support only for limited JS2 Syncfusion components like datepicker, datetimepicker, dropdownlist, multiselect, checkbox and input components . For other JS2 components, we have to handle the ‘get, set value’ in sample end using actionBegin and popupOpen events like below. 
 
onPopupOpen(args) { 
      if(args.type=='Editor'){ 
          this.listObj.value = args.data.Game || null 
      } 
    } 
    onActionBegin(args) { 
        if (args.requestType === 'eventCreate') { 
          args.data[0].Game = this.listObj.value; 
        } 
        if(args.requestType === 'eventChange') { 
          args.data.Game = this.listObj.value; 
        } 
    } 
 
Regards, 
Karthi 
 



MA Matthew August 1, 2019 10:26 AM UTC

Hi, Thanks for that. I am using resource grouping but when I click save the onActionBegin and onActionComplete events are not being triggered? If I take the AutoComplete/DropdownList components out of the editor templete they are then triggered. Do you know why this might be?


KK Karthigeyan Krishnamurthi Syncfusion Team August 2, 2019 10:19 AM UTC

Hi Matthew, 
 
Thanks for the update. 
 
In your sample, resource field may not be included in custom editor which could be the cause. We have prepared the below sample for your reference, kindly check it. 
  
Regards, 
Karthi 



MA Matthew August 5, 2019 04:00 PM UTC

Hi, Thanks for you help, I have got it working now :)


KK Karthigeyan Krishnamurthi Syncfusion Team August 6, 2019 04:27 AM UTC

Most welcome 😊 


Loader.
Live Chat Icon For mobile
Up arrow icon