Your shopping cart is empty. Browse our Store

Magento

Open Source eCommerce Evolved

Magento Forum

   
ExtJs on frontend ? 
 
kohril
Member
 
Total Posts:  42
Joined:  2007-12-23
Lille, northernFrance
 

I am tying to use ExtJs tree component in frontend. In backend, by using the following code, ext will be properly loaded :

$this->getLayout()->getBlock('root')->setCanLoadExtJs(true);

But in frontend, this line seems not to work. How can I load extJs for frontend use ?

Thanks

 Signature 

Fragento : communauté Magento francophone - http://www.fragento.com !

 
Magento Community Magento Community
Magento Community
Magento Community
 
kohril
Member
 
Total Posts:  42
Joined:  2007-12-23
Lille, northernFrance
 

--- solution ---

creating a template with following content :

<script type="text/javascript" src="<?=$this->getJsUrl()?>extjs/ext-tree.js"></script>
<script type="text/javascript" src="<?=$this->getJsUrl()?>extjs/ext-tree-checkbox.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$this->getJsUrl()?>extjs/resources/css/ext-all.css"/>
<
link rel="stylesheet" type="text/css" href="<?=$this->getJsUrl()?>extjs/resources/css/ytheme-magento.css"/>
<
script type="text/javascript">
        
Ext.BLANK_IMAGE_URL '<?=$this->getJsUrl()?>extjs/resources/images/default/s.gif';
        
Ext.UpdateManager.defaults.loadScripts false;
        
Ext.UpdateManager.defaults.disableCaching true;
</script>

Add it to header in your layout file :

<reference name="head">
        <
block type="core/template" name="my.name.extjs" template="myfolder/myextblocktemplate.phtml"/>
    </
reference>

Enjoy !

 Signature 

Fragento : communauté Magento francophone - http://www.fragento.com !

 
Magento Community Magento Community
Magento Community
Magento Community
 
gordon
Jr. Member
 
Total Posts:  14
Joined:  2007-11-07
 

Thanks for sharing. Gonna try this out.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International) to request a call-back.
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien    Privacy Policy|Terms of Service