This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Extending current sfJqueryPLugin

Forum to discuss ExtJS and other JS plugins

Re: Extending current sfJqueryPLugin

by simo » Mon Aug 24, 2009 5:38 pm

In
http://svn.symfony-project.com/plugins/sfJqueryReloadedPlugi n/1.2/trunk/lib/helper/jQueryHelper.php

Add tests at the end of :

function jq_visual_effect($effect, $element_id = false, $js_options = array())


and just dynamically rewrite jQuery code from there :
http://docs.jquery.com/UI/Effects/Blind
http://docs.jquery.com/UI/Effects/Highlight

something like that :

Code: Select all
elseif($effect == "highlight") {
return  sprintf("jQuery.effect('highlight', {}, 3000)");
}


but should be optimized...
simo
Member
 
Posts: 41
Joined: Sat May 31, 2008 8:09 am
Location: Paris

Re: Extending current sfJqueryPLugin

by JackJones » Mon Aug 24, 2009 6:03 pm

Oh :)~ :-)~ :smile:

You are faster than me:

my solution:

Code: Select all
   elseif(in_array($effect,array("highlight" ;))) {
      return  sprintf("jQuery(%s).effect('%s', { color: \"#ED00FF\" }, %s)", $element, $effect, $speed);
   }
JackJones
Member
 
Posts: 67
Joined: Thu Feb 08, 2007 6:42 pm

Re: Extending current sfJqueryPLugin

by Andromeda » Wed Jan 27, 2010 5:07 pm

I have tried this solution, but it will not work. Do I have to include any other jQuery js-files??
I'm using symfony 1.4 and the latest sfJqueryPlugin with jquery-1.3.2.min and jquery-ui-1.7.2.custom.min...

[edit]
found the solution... use $ instead of Jquery and the # infront of the element_id


Code: Select all
   $element = $element_id ? "'#$element_id'" : 'this';

   if(in_array($effect, array('hide', 'show','slideDown', 'slideUp', 'slideToggle', 'fadeIn', 'fadeOut')))
   {
      return  sprintf("$(%s).%s(%s %s );", $element, $effect, $speed, $callback);
   }
   elseif($effect == "fadeTo")
   {
      return  sprintf("$(%s).%s(%s, %s %s);", $element, $effect, $speed, $opacity, $callback);
   }
   elseif(in_array($effect, array("highlight"))) {
      return  sprintf("$(%s).effect('%s', { color: \"#ED00FF\" }, %s)", $element, $effect, $speed);
   }
   else
   {
      return  sprintf("$(%s).%s();", $element, $effect);
   }


its the only way working for me, so am I wrong or is it a bug in sfJqueryReloadedPlugin?
Andromeda
Member
 
Posts: 78
Joined: Thu Jul 03, 2008 6:55 pm
Location: Berlin, Germany

Re: Extending current sfJqueryPLugin

by Sanjuro » Thu Jun 10, 2010 4:43 pm

Hi does the new jq_input_auto_complete function support all the calls that the old input_auto_complete could handle like after_update_element, with, etc

Below is an example of what I would like to do.


Code: Select all
       <?php echo jq_input_auto_complete_tag('associategroupsearchbyid', (empty($group)?'':$group->getId()),
          'group/autocompleteassociategroup',
          array('autocomplete' => 'off',
              'size' => 38),
          array('use_style'    => true,
                'indicator' => '#associategroupsearchbyidindicator',
               'after_update_element'  => " function (inputField, selectedItem) { ".$afterupdatefunction." }",
              'with' => "'searchvalue=' + $('associategroupsearchbyid').value + '&searchtype=' + '1'",)
        ) ?>
Sanjuro
Member
 
Posts: 34
Joined: Sun Jun 29, 2008 3:59 pm

Re: Extending current sfJqueryPLugin

by TSIX » Fri Jul 09, 2010 7:21 am

This is how I got highlight working:

Code: Select all
<?php echo jq_link_to_remote('', array(
 'url' => '',
 'update' => '',
 'complete' => "$('#some-id').effect('highlight')",
)) ?>
TSIX
Junior Member
 
Posts: 7
Joined: Mon Jan 19, 2009 6:25 am
Location: Melbourne