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 » General plug-ins » sfJqueryReloadedPlugin ??
sfJqueryReloadedPlugin ?? [message #103118] Tue, 27 July 2010 09:18 Go to next message
jeob  is currently offline jeob
Messages: 7
Registered: July 2010
Junior Member
Hello,

I'am a newbie in symfony and i have some difficulties to understand how sfJqueryReloadedPlugin works.

In fact i used it with the other plugin sfFormExtraPlugin for the autocompletion function but i wonder if i really need to use this two plugins.

Just an example : i want to make a modalbox in my application and i installed the sfJqueryReloadedPlugin.
Is it necessary to use another plugin like sfModalBoxPlugin to make it ??
It's a little abstract for me.

If it is possible to just use sfJqueryReloadedPlugin to make a modalbox or another things that permit jquery could you give me a practice example.

Thank you for your help and sorry for my english Smile

EDIT :

It's not possible to just do something like that :

<?php use_helper('jQuery'); ?>

<div id="modalDiv"> message </div>

<script type="text/javascript">
 
$(function() {
	
		$("#modalDiv").dialog({
			height: 140,
			modal: true
		});
	});

</script>


He said me that the dialog function is not define :

so i tried to use this before :

<?php jq_add_plugins_by_name(array('dialog')) ?>


but he said me :

jq_add_plugins_by_name() function is not define...

What's wrong in my code ?? I'am not sure that using jquery plugin is really helpful Smile

I hope you could help me.

[Updated on: Tue, 27 July 2010 10:59]

Re: sfJqueryReloadedPlugin ?? [message #103132 is a reply to message #103118 ] Tue, 27 July 2010 15:26 Go to previous messageGo to next message
jeob  is currently offline jeob
Messages: 7
Registered: July 2010
Junior Member
Ok i progress

i used the last version of jquery :

i put file in jquery plugin directory the last version of jquery and i modified the setting.yml of the plugin like that :

 jquery_core: jquery-1.4.2.min.js
 jquery_ui: jquery-ui-1.8.2.custom.js   


So after if you want to use a modalbox you must :

in the layout(in the layout not in the others templates otherwise he said that the functions are not defined !) :

  <?php use_helper('jQuery'); ?>
     <?php jq_add_plugins_by_name(array('ui')) ?>


Note that 3 plugins are available ui,sortable and autocomplete. But integrated with this method you load all the ui widget function and you cannot load separetly different part of jquery ui(or i don't understand how)..... so it's seem going too far to have to load all the ui just for a modal box ...)

in my template _list i put my code :


<div id="modalDiv"> message </div>

<script type="text/javascript">
 
$(function() {
	
		$("#modalDiv").dialog({
			height: 140,
			modal: true
		});
	});

</script>


Ok at this point i have my modalbox but without style.. just a transparent box ...

So my question is Smile is this helper plugin jquery have a function or a mechnism to include the css automaticly.
Or i must include separately the css files of jquery theme and put the file in my web/css directory ??

[Updated on: Tue, 27 July 2010 15:34]

Re: sfJqueryReloadedPlugin ?? [message #103134 is a reply to message #103118 ] Tue, 27 July 2010 16:31 Go to previous message
jeob  is currently offline jeob
Messages: 7
Registered: July 2010
Junior Member
Ok it works i have done like that in my layout :

<LINK href="<?php echo sfConfig::get('sf_jquery_web_dir', '/sfJqueryReloadedPlugin')."/css/ui-lightness/jquery-ui-1.8.2.custom.css" ?>" rel="stylesheet" type="text/css">


But just for info maybe there are somethings that i don't understand but what is the interest of this plugin ?


First in the form : The plugin seems not enough flexible :

- including css
- Including all the ui just for some functions
- moreover you must include it in the layout so for all your pages even if you need jquery just for one part of your site.

Second in the substance :

Symfony try to dissociate controller and views so why mix php and javascript

What is the aim of generate javascript with php code ? why don't we keep the javascript in the views ?

My questions are not agressives and don't believe i'am denigrating the work of the dev team but i just want to understand.


Previous Topic:How to set default culture for sfGuard user?
Next Topic:[SOLVE][sf 1.4.6] publish asset symlink issue
Goto Forum:
  

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