[EXTENSION] jQuery UI widgets

Quote

Can some one verify:

alwaysOpen is missing as a validOptions array element in EAccordion.php

That option was removed in 1.7.1: http://jqueryui.com/demos/accordion/

Will we see sortable and draggable? Or better bound to a yii callback function to store the sort "array" in databse. If not how could i archive this with JQuerryUI? I dont find any documentation about callbacks. To get the "table" array. Of the resorted elements… ;(

Quote

Will we see sortable and draggable? Or better bound to a yii callback function to store the sort "array" in databse. If not how could i archive this with JQuerryUI? I dont find any documentation about callbacks. To get the "table" array. Of the resorted elements... ;(

I think this is most a jQuery UI question. Maybe those guys can give you a hint.

Hi, is there a posability to say the accordeon widget which panel is visible at start (after loading the page)? Or, how works the active function? I can not get into it…

For the width option you have:

While the default in jquery is 300 I think like the height you are allowed to specify auto as a value.

so for the option width you should have:

tried all options of course not being a jquery person did trail and error

Folks, if you're looking for a jQuery UI widget that is not included in MetaYii's awesome extensions, you can use my CPSjqUIWrapper class (part of the Pogostick Yii Extensions Library in extensions) to create it and use it.

Hi,

i have a question, how is the active option in the accordeon widget been used? I think i have tried everythink. Which value i have to set in active to show the second panel at startup? Can somebody help me?

I have been stuck there. Tired options and used jQuery to force the DIV, but no luck. This is will so helpful

Which accordian wrapper are you using? MetaYii's or the Pogostick one?

For Pogostick, do this:

CPSjqUIWrapper::create( 'accordian', array( 'target' => 'cssSelector' ) );

Replace 'cssSelector' with your div's id (i.e. '#myDiv') or class name (i.e. '.myClass').

With MetaYii, no clue. lol sorry.

Hi ,

Would like to find out how to make the jsquery dialog "modal" ?

When I call up the dialog , I would like to make all my other forms element disabled and re-activate after I close the dialog ?

Thanks.

Kalmen

Hi ,

Sorry , I found I should  go to read the code before I ask question,

well we just need to set the options , "modal"=>true , that's all ,great

extension . Thanks.

Hi,

we have clarified the issue with the accordions active-property mentioned by Lollinger.de in the german forum.

It seems to be a bug in EAccordion.php (JUI v. 2.4.1):

Line 122: 'active'=>array('type'=>array('boolean', 'number')),

should not be 'number' but 'integer' and why did you remove 'string' as a valid type?!

I would suggest:

Line 122: 'active'=>array('type'=>array('boolean', 'string', 'integer')),

Greetings,

yoshi

I have noticed when configuring the datePicker that the options array strings need to be enclosed in quotes twice, ie.

'options'=>array('altFormat'=>"'dd-M-yy'",),

Yoshi - Thanks a lot.

MetaYii, you're such a maniac. Thanks for all the wonderful extensions. Many developers would come home earlier and see their family more often!

Quote

Quote

@kvl: sorry, I can't reproduce your problem with jui 2.2

ok, I was using the old version…

Sorry - and thanks to you!

I am have the same problem @kvl was having with jui 2.2.  I'm using 2.4.1 and I get the same error he was getting if I try to display 2 datepickers on one page (see stack trace below).

To prevent the error occurring I've put is_array checks around the foreach $this->callbacks loops (EDatePicker.php:546 and :552), however I'm yet to discover if this is causing any problems with the 2nd date picker.

PHP Error


Description





Invalid argument supplied for foreach()


Source File





/var/www/vhosts/about-australia/protected/extensions/jui/EDatePicker.php(548)





00536:          case 'imagebutton':


00537:             if ($this->image === '') {


00538:                $this->image = $this->baseUrl.'/images/calendar.gif';


00539:             }


00540:             $options['showOn'] = "'" . $this->showOn . "'";


00541:             $options['buttonImage'] = "'" . $this->image . "'";


00542:             $options['buttonImageOnly'] = 'true';


00543:             break;


00544:       }


00545: 


00546:       //if (is_array($this->callbacks))


00547:       //{


00548: foreach ($this->callbacks as $key=>$val) {


00549:             $options['callback_'.$key] = $key;


00550:          }         


00551:       //}


00552: 


00553:       $encodedOptions = self::encode(array_merge($options, $this->options));


00554: 


00555:       //if (is_array($this->callbacks))


00556:       //{      


00557:          foreach ($this->callbacks as $key=>$val) {


00558:             $encodedOptions = str_replace("callback_{$key}:{$key}", "{$key}: {$val}", $encodedOptions);


00559:          }


00560:       //}





Stack Trace





#0 /var/www/vhosts/about-australia/protected/extensions/jui/EDatePicker.php(576): EDatePicker->makeOptions()


#1 /var/www/vhosts/about-australia/protected/extensions/jui/EDatePicker.php(634): EDatePicker->jsCode()


#2 /var/www/vhosts/yii/framework/web/CBaseController.php(154): EDatePicker->run()


#3 /var/www/vhosts/about-australia/protected/components/views/searchAndBook.php(123): SearchAndBook->widget()


#4 /var/www/vhosts/yii/framework/web/CBaseController.php(123): require()


#5 /var/www/vhosts/yii/framework/web/CBaseController.php(88): SearchAndBook->renderInternal()


#6 /var/www/vhosts/yii/framework/web/widgets/CWidget.php(197): SearchAndBook->renderFile()


#7 /var/www/vhosts/about-australia/protected/components/SearchAndBook.php(36): SearchAndBook->render()


#8 /var/www/vhosts/about-australia/protected/components/Portlet.php(22): SearchAndBook->renderContent()


#9 /var/www/vhosts/yii/framework/web/CBaseController.php(154): SearchAndBook->run()


#10 /var/www/vhosts/about-australia/protected/views/layouts/three_columns.php(16): PageController->widget()


#11 /var/www/vhosts/yii/framework/web/CBaseController.php(119): require()


#12 /var/www/vhosts/yii/framework/web/CBaseController.php(88): PageController->renderInternal()


#13 /var/www/vhosts/yii/framework/web/CController.php(642): PageController->renderFile()


#14 /var/www/vhosts/about-australia/protected/controllers/PageController.php(59): PageController->render()


#15 /var/www/vhosts/yii/framework/web/actions/CInlineAction.php(32): PageController->actionShow()


#16 /var/www/vhosts/yii/framework/web/CController.php(300): CInlineAction->run()


#17 /var/www/vhosts/yii/framework/web/filters/CFilterChain.php(129): PageController->runAction()


#18 /var/www/vhosts/yii/framework/web/filters/CFilter.php(41): CFilterChain->run()


#19 /var/www/vhosts/yii/framework/web/CController.php(949): CAccessControlFilter->filter()


#20 /var/www/vhosts/yii/framework/web/filters/CInlineFilter.php(59): PageController->filterAccessControl()


#21 /var/www/vhosts/yii/framework/web/filters/CFilterChain.php(126): CInlineFilter->filter()


#22 /var/www/vhosts/yii/framework/web/CController.php(283): CFilterChain->run()


#23 /var/www/vhosts/yii/framework/web/CController.php(257): PageController->runActionWithFilters()


#24 /var/www/vhosts/yii/framework/web/CWebApplication.php(332): PageController->run()


#25 /var/www/vhosts/yii/framework/web/CWebApplication.php(120): CWebApplication->runController()


#26 /var/www/vhosts/yii/framework/base/CApplication.php(133): CWebApplication->processRequest()


#27 /var/www/vhosts/about-australia/index.php(15): CWebApplication->run()





Another bug with the DatePicker when using 'showButtonPanel'=>true, but it's very obscure.  I'm using a datepicker in a custom widget, and when I use showButtonPanel the following occurs:

  • After editing the widget code, the first load of the page is fine
  • If I then F5 refresh, or Ctrl+F5, the page is completely blank.  No HTML source, no PHP errors logged, nothing in the Yii application log.
  • To get the page to load again, I have to touch the view file for the widget

Can you provide any tips on how I could debug this to find a solution?

Is there a possibility to use the ETabs class with tabs in tabs?

The regexp to get the create the li's from the body text creates allways the links also for embeded tabs.

excample:

<?php $this->beginWidget('application.extensions.jui.ETabs', array('name'=>'tabpanel1')); ?>


   <?php $this->beginWidget('application.extensions.jui.ETab', array('name'=>'tab1', 'title'=>'Tab 1')); ?>


       <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>


   <?php $this->endWidget('application.extensions.jui.ETab'); ?>


    <?php $this->beginWidget('application.extensions.jui.ETab', array('name'=>'tab2', 'title'=>'Tab 2')); ?>


    <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>


    <?php $this->endWidget('application.extensions.jui.ETab'); ?>


    <?php $this->beginWidget('application.extensions.jui.ETab', array('name'=>'tab3', 'title'=>'Tab 3')); ?>


        <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>


        <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>








        <?php $this->beginWidget('application.extensions.jui.ETabs', array('name'=>'tabpanel2')); ?>


         <?php $this->beginWidget('application.extensions.jui.ETab', array('name'=>'tab1', 'title'=>'Tab 2.1')); ?>


         <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>


       <?php $this->endWidget('application.extensions.jui.ETab'); ?>


        <?php $this->beginWidget('application.extensions.jui.ETab', array('name'=>'tab2', 'title'=>'Tab 2.2')); ?>


        <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>


        <?php $this->endWidget('application.extensions.jui.ETab'); ?>


        <?php $this->endWidget('application.extensions.jui.ETabs'); ?>





    <?php $this->endWidget('application.extensions.jui.ETab'); ?>


<?php $this->endWidget('application.extensions.jui.ETabs'); ?>


Hi, great extension!

I have a question, I have a page 'A' with a dialog that works fine.

When I add the tabs extension in a page 'B' with ajaxTabs where one of the tabs call to the page 'A' the the dialog widget doesn't work :S (on the A page) and I don't know way. Any ideas?

Thanks!