This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » Javascript plugins » Extending current sfJqueryPLugin
Re: Extending current sfJqueryPLugin [message #84292 is a reply to message #54990 ] Mon, 24 August 2009 17:38 Go to previous messageGo to next message
simo  is currently offline simo
Messages: 41
Registered: May 2008
Location: Paris
Member
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 :

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


but should be optimized...
Re: Extending current sfJqueryPLugin [message #84296 is a reply to message #84292 ] Mon, 24 August 2009 18:03 Go to previous messageGo to next message
JackJones  is currently offline JackJones
Messages: 67
Registered: February 2007
Member
Oh Smile

You are faster than me:

my solution:

	elseif(in_array($effect,array("highlight"))) {
		return  sprintf("jQuery(%s).effect('%s', { color: \"#ED00FF\" }, %s)", $element, $effect, $speed);
	}
Re: Extending current sfJqueryPLugin [message #92329 is a reply to message #54990 ] Wed, 27 January 2010 16:07 Go to previous messageGo to next message
Andromeda  is currently offline Andromeda
Messages: 64
Registered: July 2008
Location: Berlin, Germany
Member
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


	$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?

[Updated on: Wed, 27 January 2010 18:04]

Re: Extending current sfJqueryPLugin [message #100738 is a reply to message #54990 ] Thu, 10 June 2010 16:43 Go to previous messageGo to next message
Sanjuro  is currently offline Sanjuro
Messages: 28
Registered: June 2008
Junior Member
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.


		 <?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'",)
		  ) ?>

[Updated on: Thu, 10 June 2010 16:43]

Re: Extending current sfJqueryPLugin [message #102229 is a reply to message #54990 ] Fri, 09 July 2010 07:21 Go to previous message
TSIX  is currently offline TSIX
Messages: 7
Registered: January 2009
Location: Melbourne
Junior Member
This is how I got highlight working:

<?php echo jq_link_to_remote('', array(
 'url' => '',
 'update' => '',
 'complete' => "$('#some-id').effect('highlight')",
)) ?>
Previous Topic:why use php to create javascript?
Next Topic:Jquery rating system and symfony
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software