View Full Version : Conflicts between ExtJs 4.1.0 and Mootools on Joomla

15 Jun 2012, 1:36 AM

I was recently designated to update a component Joomla, which use the framework ExtJs.
I developped an application and when I incorporated it to the existent component I got some errors.
Most are resolved by updating ExtJs to 4.1.0 (before it was 4.0.X, I don't remember the number version).

So, when I updated the library, everything was working until I started to edit an article (always in Joomla). The application use Mootools to detect events which begin the recording process of the article (it's what i think to understand by reading the code in the component com_content). The message I received is :

TypeError: Property 'id' of object #<HTMLDocument> is not a function

Mootools takes back the form :

<script type="text/javascript">

Joomla.submitbutton = function(task) { if (task == 'article.cancel' || document.formvalidator.isValid(document.id('item-form'))) {Uncaught TypeError: Property 'id' of object #<HTMLDocument> is not a function if (tinyMCE.get("jform_articletext").isHidden()) {tinyMCE.get("jform_articletext").show()}; tinyMCE.get("jform_articletext").save(); Joomla.submitform(task, document.getElementById('item-form')); } else { alert('Formulaire invalide'); } }

This is the code if the component com_content, wrote by Joomla and I don't think it's judicious change it. The problem appears when the form is recovered : document.id('item-form')).

A plugin is installed at the same time of the component where I intervene which allow to add a button in the editing page of article and which control the apparition of a windows created by ExtJs.
So this library is loaded at the same time of this page. I made some test : I removed the javascript code which call ExtJs functions without remove the library, it doesn't work. When I removed all (code and library refering to ExtJs), I can record my article.

All along the development of my application on Joomla, I got this type of error but it never blocked the functionning. Until now ...

I hope somebody can help me, and for that I wish I made myself clear.
(forgive my english, I'm french ... :))

Thank you

15 Jun 2012, 6:12 PM
Are you referring to JGrid or another product?
Have you tried to contact the vendor?


21 Jun 2012, 11:24 AM
To whom it may concern :
T (http://www.developpez.net/forums/d1233690/webmasters-developpement-web/javascript/bibliotheques-frameworks/ext-js-sencha/conflits-extjs-4-1-0-mootools-joomla/)he solution is here (in French) :)

7 Oct 2013, 5:45 AM
Load mootools, then add this script

Load Extjs with this code

<script src="ext.js"></script>
restore the value for mootools and Extjs

document.id = Ext.documentId