How to add your favorite jQuery UI plugin as a Raxan widget

Imagine you have found the latest jQuery DatePicker that has all of the latest bells & whistles (like the one created by Keith Wood at http://keith-wood.name/datepick.html). Like most jQuery plugins, it comes with the jquery plugin (.js) file, a css file, and an example html file. So, how do you quickly add this to Raxan as a reusable widget? Simple.

Step 1: Copy the jQuery plugin file(s) to the raxan ui/javascripts directory

Step 2: Copy the plugin's css file(s) to the raxan ui/css directory

Step 3: Create the Raxan widget class file

<?php

    class DatePickerWidget extends RaxanUIWidget {

        protected function _init() {
            // load the stylesheet jquery.datepick.css
            $this->page->loadCSS('jquery.datepick');
            // load the javascript
            $this->page->loadScript('jquery.datepick');
            // Bind the datepicker to the element
            // Note that elmID is created in the RaxanUIWidget constructor so it is
            // available here as the jQuery selector
            c('#'.$this->elmId)->datepick();
        }
    }

?> 

Step 4: Load the new DatePickerwidget in your page controller class

<?php
    require_once 'raxan/pdi/autostart.php';
    Raxan::loadWidget('datepickerwidget');

    class IndexPage extends RaxanWebPage {

        protected function _config() {
            $this->masterTemplate ='views/master.html';
        }

        protected function _init() {
            $this->appendView('mypage.html');
        }
    }

?>

Step 5: Start using your new DatePickerWidget in your views

<div class="container">
     <form id="addEmployee" method="post">
        <p>
            <label class="rax-light-title" for="employeeName">Employee Name</label>  
            <input id="employeeName" class="textbox c26 round" />
        </p>
        <p>
            <label class="rax-light-title" for="employeeBirthDate">
            Employee Birth Date</label>
            <br/><input id="employeeBirthDate" 
            class="textbox c17 round" xt-ui="DatePickerWidget" />
        </p>
        <p>
            <input id="cmdAdd" type="submit" class="left button rtm " 
            value="Add Employee" xt-bind="#click,saveEmployee,,true" />       
        </p>
    </form>
</div>

Now, when you want to use the DatePickerWidget on any page, all you have to do is call Raxan::loadWidget('datepickerwidget') in the page controller, and add the xt-ui="DatePickerWidget" on the elements that are used to get dates. Really nice!

Stella
Posts: 833
Comment
I read your <a href=
Reply #10 on : Sat April 15, 2017, 16:09:30
I read your <a href="http://ptneqs.com">ponistg</a> and was jealous
adidas micropacer og metallic silver
Posts: 833
Comment
Enterprise169
Reply #9 on : Sat October 06, 2018, 02:44:29
<a href="http://www.visitaciudades.com/on sale/air-jordan-14-retro-womens-shoes-grey-black-for-sale">air jordan 14 retro womens shoes grey black for sale</a><a href="http://www.visitaciudades.com/online-sale/nike-air-jordan-17-ret-low-solefly-solefly">nike air jordan 17 ret low solefly solefly</a><a href="http://www.visitaciudades.com/online-shop/nike-air-max-90-se-leather-gs-black-black-dark-grey">nike air max 90 se leather gs black black dark grey</a><a href="http://www.visitaciudades.com/online/nike-air-max-95-mens-black-grey-purple-orange-green">nike air max 95 mens black grey purple orange green</a>
[url=http://www.sitnlearn.com/free-delivery/adidas-micropacer-og-metallic-silver]adidas micropacer og metallic silver[/url]
nike lunar command 2 mens golf shoe white white black 849968 100
Posts: 833
Comment
Likeness199
Reply #8 on : Sun October 21, 2018, 20:00:29
<a href="http://www.dbdotechnology.com/on sale/nike-sb-verge-sunglasses">nike sb verge sunglasses</a><a href="http://www.dbdotechnology.com/online-sale/2017-buy-cheap-nike-air-max-tavas-shoes-sale-black-friday">2017 buy cheap nike air max tavas shoes sale black friday</a><a href="http://www.dbdotechnology.com/online-shop/new-nike-tiempo-legend-6">new nike tiempo legend 6</a><a href="http://www.dbdotechnology.com/online/new-balance-811-wide">new balance 811 wide</a>
[url=http://www.realestations.com/just-release/nike-lunar-command-2-mens-golf-shoe-white-white-black-849968-100]nike lunar command 2 mens golf shoe white white black 849968 100[/url]
air jordan retro collection
Posts: 833
Comment
Maaike231
Reply #7 on : Mon November 12, 2018, 20:41:18
<a href="http://www.sistco.com/authentic/new-balance-610-v5">new balance 610 v5</a><a href="http://www.sistco.com/best-seller/nike-air-jordan-1-high-gs-prm">nike air jordan 1 high gs prm</a><a href="http://www.sistco.com/big-sale/nike-running-shoes-online">nike running shoes online</a><a href="http://www.sistco.com/black-friday/mens-nike-fi-rue-zoom-black-white-shoes">mens nike fi-rue zoom black white shoes</a>
[url=http://www.gfi-intl.com/2018/air-jordan-retro-collection]air jordan retro collection[/url]
womens nike air max tn running shoes white leather grey silver
Posts: 833
Comment
Raxan965
Reply #6 on : Tue November 20, 2018, 01:07:50
<a href="http://www.chefhattips.com/2018-online/nike-lebron-15-city-edition-wolf-grey-metallic-gold-cool-grey-outlet">nike lebron 15 city edition wolf grey metallic gold cool grey outlet</a><a href="http://www.chefhattips.com/2018-top/nike-air-foamposite-one-shine-for-sale">nike air foamposite one shine for sale</a><a href="http://www.chefhattips.com/2019_release/nike-mercurial-vortex-iii-fg-mens-soccer-shoes-cristiano-ronaldo-seaweed-hasta-white-volt">nike mercurial vortex iii fg mens soccer shoes cristiano ronaldo seaweed hasta white volt</a><a href="http://www.chefhattips.com/awesome/real-nike-hyperchase-artisan-teal-light-retro-black-hot-lava">real nike hyperchase artisan teal light retro black hot lava</a>
[url=http://www.farahesaban.com/clearance/womens-nike-air-max-tn-running-shoes-white-leather-grey-silver]womens nike air max tn running shoes white leather grey silver[/url]
nike air max 95 premium w shoes
Posts: 833
Comment
Yap385
Reply #5 on : Tue November 27, 2018, 20:12:54
<a href="http://www.saylesfordelegate.com/es/tenis-adidas-adizero-precio">tenis adidas adizero precio</a><a href="http://www.saylesfordelegate.com/femme/nike-lunar-force-1-fuse-lthr-mens-shoes-wolf-grey-dp-ryl-blue-atmc-rd-10.5">nike lunar force 1 fuse lthr mens shoes wolf grey dp ryl blue atmc rd 10.5</a><a href="http://www.saylesfordelegate.com/fr/adidas-adipure-flex-wd-zapatos-de-golf-para-hombre-blanco-negro-plata-40.6-eu">adidas adipure flex wd zapatos de golf para hombre blanco negro plata 40.6 eu</a><a href="http://www.saylesfordelegate.com/heren/zapatillas-nike-nueva-temporada-outlet-baratas-espa%c3%b1a-2018">zapatillas nike nueva temporada outlet baratas espa?a 2018</a>
[url=http://www.ilovemlg.com/mujer/nike-air-max-95-premium-w-shoes]nike air max 95 premium w shoes[/url]
nike free run sale dames
Posts: 833
Comment
Question622
Reply #4 on : Mon January 14, 2019, 14:35:24
<a href="http://www.rueckstauklappe.com/uppkopplad/chaussures-adidas-falcon-elite-5-w">chaussures adidas falcon elite 5 w</a><a href="http://www.rueckstauklappe.com/uusi/nike-flyknit-roshe-run-prm-black">nike flyknit roshe run prm black</a><a href="http://www.rueckstauklappe.com/vrouw/nike-zoom-rival-s-9-femmes-chaussures-de-course-%c3%a0-pointes-ho18">nike zoom rival s 9 femmes chaussures de course ? pointes ho18</a><a href="http://www.rueckstauklappe.com/zni?ka/nike-schuhe-gr%c3%b6sse-36-junge">nike schuhe gr?sse 36 junge</a>
[url=http://www.bamhuyetchamcuutainha.com/halpa/nike-free-run-sale-dames]nike free run sale dames[/url]
nike sb check solar skate zapatos para hombre negro blanco casual zapatillas zapatillas
Posts: 833
Comment
Template321
Reply #3 on : Sun March 24, 2019, 20:05:47
<a href="http://www.synergytsa.com/upper/new-balance-furon-4-0-pro-firm-ground-femme">new balance furon 4 0 pro firm ground femme</a><a href="http://www.synergytsa.com/vente/nike-womens-eclipse-ii-premium-mujer">nike womens eclipse ii premium mujer</a><a href="http://www.synergytsa.com/verkoop/adidas-pro-conference-dame">adidas pro conference dame</a><a href="http://www.synergytsa.com/worthy/asics-gel-lyte-iii-camo-pack-aloe-mujer">asics gel lyte iii camo pack aloe mujer</a>
[url=http://www.clickconnectgo.com/replica/nike-sb-check-solar-skate-zapatos-para-hombre-negro-blanco-casual-zapatillas-zapatillas]nike sb check solar skate zapatos para hombre negro blanco casual zapatillas zapatillas[/url]
nike air jordan 1 retro high black cement grey white dames
Posts: 833
Comment
Genetic302
Reply #2 on : Fri March 29, 2019, 19:12:28
<a href="http://www.akarwwtp.com/it/homme-air-jordan-4-noir-et-bleu">homme air jordan 4 noir et bleu</a><a href="http://www.akarwwtp.com/label/nike-air-jordan-retro-xi-11-low-2015-mujer">nike air jordan retro xi 11 low 2015 mujer</a><a href="http://www.akarwwtp.com/merchant/scarpe-nike-scontate-on-line">scarpe nike scontate on line</a><a href="http://www.akarwwtp.com/nike/air-max-flyknit-pas-cher-taille-39">air max flyknit pas cher taille 39</a>
[url=http://www.mississaugapalace.com/sprzedaz/nike-air-jordan-1-retro-high-black-cement-grey-white-dames]nike air jordan 1 retro high black cement grey white dames[/url]
2017 best nike roshe womens running shoes baby pink
Posts: 833
Comment
Gerald374
Reply #1 on : Sat March 30, 2019, 20:14:18
<a href="http://www.gocnongnghiep.com/near_me/nike-air-jordan-1-6-rings-red-555088-112-09">nike air jordan 1 6 rings red 555088 112 09</a><a href="http://www.gocnongnghiep.com/news/vans-x-storm-low-top-red-with-flames">vans x storm low top red with flames</a><a href="http://www.gocnongnghiep.com/new_released/nike-air-max-90-premium-brown-lime">nike air max 90 premium brown lime</a><a href="http://www.gocnongnghiep.com/no_tax/nike-kyrie-2-snapdeal">nike kyrie 2 snapdeal</a>
[url=http://www.hipnozistanfolyam.com/Footwear/2017-best-nike-roshe-womens-running-shoes-baby-pink]2017 best nike roshe womens running shoes baby pink[/url]
First | Previous | Showing comments 781 to 790 of 790

Leave a Comment

Required fields are marked with *.
If you have trouble reading the code, click on the code itself to generate a new random code.