Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Embed Framework

Embed Framework 13 May 2013 12:35 #7179

  • albert
  • albert's Avatar
  • Offline
  • Senior Member
  • Posts: 70
  • Thank you received: 2
  • Karma: 2
Hi,

i did a component, and i found the famous cancel button does not work on frontpage.
i am using JS Framework Jquery

I tried that using the embed framework the problem is solved, but i already modified a lot the generated component, can someone tell me exactly which lines or modifications do the option Embed Framework yes or not?

thanks in advance
Albert
The administrator has disabled public write access.

Re: Embed Framework 13 May 2013 15:00 #7184

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hi Albert
The two names $ and jQuery are synonyms. jQuery is the more explicit; $ may be overridden if you use another framework.

If you pass a function as the first argument to your call to the jQuery function (or, obviously, to $), it is executed exactly as if it were a call to jQuery(document).ready. So yes, it is exactly the same.

Indeed, all these are functionally equivalent (provided you don't have anything else mucking around with $)
as said here

I have found that when using jQuery in j-cook components, you should use jQuery explicit if the "Cancel" button on the view is to remain functional.

Go through your view and change all the jQuery - $ references to the word jQuery and report back to help the others who may follow. Linked JS files are not exempted

Regards
v

Note: If your code breaks you have missed a $ or 2 somewhere, find it and... :)
Last Edit: 13 May 2013 15:06 by vlemos.
The administrator has disabled public write access.
The following user(s) said Thank You: albert

Re: Embed Framework 15 May 2013 08:43 #7190

  • albert
  • albert's Avatar
  • Offline
  • Senior Member
  • Posts: 70
  • Thank you received: 2
  • Karma: 2
In fact what i did is to replace the code on the helper file
on the headerDeclarations function
as follows
		$componentUrl ...
		$componentUrlAdmin ...

		//Javascript
		$doc->addScript($siteUrl . '/media/system/js/core.js');
		$doc->addScript($componentUrlAdmin . '/dom/assets/jdom.js');
		$doc->addScript($componentUrlAdmin . '/js/formvalidator.js');

		//CSS
		if ($app->isAdmin())
		{....

and now it works fine
The administrator has disabled public write access.
Time to create page: 0.125 seconds

Get Started