Forums

PrintArea revisited. MooTools versio busted Joomla 3

NickOg 21 Sep, 2014
Hi Bob,

A while ago now you helped me sort out some 'clash' between MooTools and jQuery. (http://www.chronoengine.com/forums/posts/f2/t89587/print-button.html). I came across jQueryEasy and that combination of your MooTools code and jQueryEasy has worked fine (and continues to do so) on our production site www.pmhu3a.org.au running Joomla 2.5.24.

However, on the my Joomla 3 version (www.dev303.pmhu3a.org.au) the function no longer works. An example of that failure is at http://www.dev303.pmhu3a.org.au/mnumembershipfront/apply-post

The error is back to

TypeError: window.addEvent is not a function
http://www.dev303.pmhu3a.org.au/mnumembershipfront/apply-post
Line 48


I have added a testbed - testMooTools to go back to your original FAQ but that gives the same problem.

TypeError: window.addEvent is not a function
http://www.dev303.pmhu3a.org.au/testmootools?chronoform=testBedMooTools&event=submit
Line 43


In desperation I have tried to use a jQuery plugin- (http://www.jqueryscript.net/other/Print-Specified-Area-Of-A-Page-PrintArea.html)

but I get another problem. That is under testjQuery.(form

TypeError: $ is not a function
http://www.dev303.pmhu3a.org.au/components/com_chronoforms/js/load_js.php?code=d69a85ea6f25a6f3787295dac4baf3a97edc52beeNortrIwt1JSXDACFQ2llMwy5YKizLyS-KTSkpL8PCVNveSczORsjbTSvOSSzPw8Dc1qXi6EYr1cMJBix6LURKDKAhhbQ9Oal6sWRChZA1wwWMUb4Q,,
Line 1


I am absolutely stuck and hope that you can help sort this out again.
NickOg 22 Sep, 2014
Further to that - I have built a Jooma 3.3 site from scratch, only installing Chronoforms and the test bed I mentioned.www.j300.pmhu3a.org.au.

No different - same problems. Even more stuck!

Nick
Max_admin 22 Sep, 2014
Answer
Hi Nick,

Mootools is not loaded on the dev site I think, please make sure its using a custom code action.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
NickOg 22 Sep, 2014
Hi Max

Oh! Now I have never done that before I think. I must assume that it was preloaded in earlier versions. Is there some FAQ around as to how to do that? Must go look

Thanks

Nick
GreyHead 22 Sep, 2014
Hi Nick,

Good to see you got his sorted. I'm travelling this week but when I have some time I'll re-write the print code in jQuery to save this hassle. It should be a fairly small change.

Bob
NickOg 22 Sep, 2014
Hi Bob

Yes - a good fix easy applied. One day - one day - I will get chance to learn jQuery myself.

Trust that your travels are enjoyable.

As ever I truly appreciate the support out of ChronoEngine..

Regards

Nick
GreyHead 26 Sep, 2014
1 Likes
Hi Nick,

I've just updated the FAQ to include Print Button code for CFv5 using jQuery.

Bob
NickOg 26 Sep, 2014
Thanks Bob - and for Joomla 3 jquery is now the preferred/standard option I gather. I will give it a try.

Nick
NickOg 26 Sep, 2014
Works fine Bob. One thing threw me for a while. It complained that jQuery was not defined. I had assumed that JQuery would have been loaded by default. Apparently not. I fixed it by enabling jQueryEasy. Is it worth including a conditional up front to load jQuery if it is not already loaded? Or have I missed something?

Nick
NickOg 26 Sep, 2014
Just noticed that you mentioned that was for CFV5 - I have used it on CFV4 and, as I said, works fine, except for jQuery not loading.
GreyHead 27 Sep, 2014
Hi Nick,

It's loaded by default on my Joomla! 3.3. test site using the default template. If it isn't loaded then you can require the Joomla! version with the code in this FAQ - similar to the MooTools code from earlier in the thread. Sometimes this is required to handle timing problems as Joomla! sometimes isn't too clever in getting the load sequence correct.

Bob
NickOg 07 Jan, 2015
Hi Bob,
Back to this again. JKust converting to Chronoforms V5 and am stuck with this error.
Fatal error: Call to undefined method JDocumentHTML::addJsCode() in /hsphere/local/home/pmhu3a0/devj314.pmhu3a.org.au/administrator/components/com_chronoforms5/chronoforms/actions/html/html.php on line 509 

I have picked up the V5 code from your FAQ but can't get past this.

Any suggestion as to what i have done wrong?

Regards

Nick
NickOg 07 Jan, 2015
Whoops - sorted, Placed the code in the wrong spot. Please disregard previous message.

:? 😲
Sorry
Nick
This topic is locked and no more replies can be posted.