JQuery-UI and jQuery-DataTable compatibility with Lightning Locker Service

Is there any version of following libraries:

That are compatible with Locker Service?

When using .autocomplete() function from jQuery-UI I’m getting following error:

Something has gone wrong. afterRender threw an error in 'markup://aura:html' 
[afterRender threw an error in 'markup://aura:html' 
[afterRender threw an error in 'markup://aura:html' 
[afterRender threw an error in 'markup://aura:html' 
[afterRender threw an error in 'markup://aura:html' 
[afterRender threw an error in 'markup://c:CPQ_UTIL01_Autocomplete'
[TypeError: Cannot define property:jQuery224091732131111102392, object is not extensible.]]]]]] 
Failing descriptor: {markup://aura:html}. Please try again.

Also .tooltip() function from Bootstrap is not working for me.

I’m trying to bring back some functionalities that are built on these libraries.

Case is already opened: #14139006

Answer

Actually for jQuery-UI it seems to be working, the issue was of different nature:

In the original scenario I had:

<ui:inputText aura:id="autocomplete" ...>

And I was trying to do:

$(autocomplete).autocomplete({
   ...
});

It seems that secure DOM introduced by locker service very effectively forces ownership of DOM elements, and I was not able to put autocomplete function on a different component (ui:inputText)

After changing the view to standard:

<input type="text" ... >

All seems to be working.

Attribution
Source : Link , Question Author : Maciek Simm , Answer Author : Maciek Simm

Leave a Comment