Layout

Discuss anything that's related to the Raxan framework

Layout

Postby fc_enriqueism » Thu Nov 10, 2011 6:51 pm

Hi!
I want to build a widget to aply the jQuery UI Layout Plug-in to my master.php
Code: Select all
class LayoutWidget extends RaxanUIWidget {
        protected function _init() {
            $this->page->loadScript('jquery');   //load jquery
            $this->page->loadScript('border/jquery-layout'); //load datatables
            c($this->elmId)->layout(array(
               'applyDefaultStyles' => true,
               'north__size' => 50,
               'west__size' => 200
            )); // load layout
       }

Should I need to put
Code: Select all
 Raxan::loadWidget('layout');
in avery page that use the master.php template?, or how can I do It?.
Thanks.
fc_enriqueism
 
Posts: 10
Joined: Wed Sep 28, 2011 12:25 am

Re: Layout

Postby fc_enriqueism » Thu Nov 10, 2011 7:50 pm

or to include a menu plugin like http://nettuts.s3.amazonaws.com/004_Moo/tutorial/demo/demo.html into the template.
Thanks
fc_enriqueism
 
Posts: 10
Joined: Wed Sep 28, 2011 12:25 am

Re: Layout

Postby raymond » Thu Nov 17, 2011 3:29 am

Hi,

There are a few ways you can include the widget:

1. Add Raxan::loadWidget('layout'); to every page that uses the widget
2. Add Raxan::loadWidget('layout'); to master.php or to another common include file
3. Use the preload.widgets config option:

Code: Select all
    $config['preload.widgets'] = 'layout';
    //preload.widgets - Comma (,) delimited list of UI widgets to be loaded from widgets.path


Best regards,
__
Raymond
raymond
Site Admin
 
Posts: 215
Joined: Tue Mar 17, 2009 5:04 am

Re: Layout

Postby fc_enriqueism » Thu Nov 17, 2011 5:51 pm

Thanks, the "preload.widgets" works great. I have another question is necessary to include jquery
Code: Select all
$this->page->loadScript('jquery');

on each widget? even if the framework loads it by default?
fc_enriqueism
 
Posts: 10
Joined: Wed Sep 28, 2011 12:25 am

Re: Layout

Postby raymond » Fri Nov 18, 2011 4:25 am

Most of the time it's not necessary to load jQuery from within the widget. The framework will auto-load jQuery if an event or client-side action method (bind, delegate, c, updateClient, etc) is called
raymond
Site Admin
 
Posts: 215
Joined: Tue Mar 17, 2009 5:04 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron