x-editable : Cannot read properties of undefined (reading '_off')

400 views Asked by At

I'm using x-editable with jqueryui library (jqueryui-editable v1.5.1)

However I've suddenly got this error :

Cannot read property '_off' of undefined

It seems the error is raised by this line :

this.container()._off(this.container().element, 'mouseover focusin');

line 4717, because this.container() is null.

I don't really figure out why.. ?

1

There are 1 answers

0
AlexB On

It seems Bootstrap and jqueryui-editable conflict each other.

I've found the explanation on the project creator's github

This problem is related with simultaneous usage of jQueryUI and Bootstrap: both jquery-ui and bootstrap add $.tooltip method. When used together bootstrap overwrites it and we get error.
The solutions I can suggest:
1. try to include jQueryUI after bootstrap.
2. Better way is to use bootstrap's noConflict method. Run this after including BS :
$.fn.bstooltip = $.fn.tooltip.noConflict();

The second solution, using $.fn.bstooltip = $.fn.tooltip.noConflict(); worked for me.