sorry, i wrote .js wrong. It still doen't work inside modalbox, but
the correct code is
<?php
$javascript->codeBlock("
jQuery(function() {
alert('funciona');
});
",array('inline'=>false));
?>
About Firebug, in both cases (inline true or false), nothing appears.
That is why i know that the <script> is not called. I read something
about that in modalbox home page. They've talked about evalScripts,
but i didn't understand how to use.
On 4 ago, 14:37, Persivo Cunha <[email protected]> wrote:
> Yes.
>
> layout -> default.ctp ------------------------------------------------
> ...
> echo $html->css('projet');
> echo $javascript->link('jquery_1.4.2');
> echo $javascript->link('jquery-ui-1.8.2.custom.min');
> echo $javascript->link('projet');
> ....
>
> add.ctp (page which calls modalbox) ----------------------------
>
> <?php echo $html->css('cadastros',null,array(),false); ?>
> <?php echo $html->css('modalbox',null,array(),false);?>
> <?php echo $html->css('table_design',null,array(),false); ?>
> <?php echo $html->css('jquery-ui-1.8.2.custom',null,array(),false);?>
> <?php $javascript->link(array('prototype','modalbox','scriptaculous.js?
> load=effects'),false); ?>
> <?php $javascript->link('cadastros',false); ?>
>
> <?php $javascript->codeBlock("
> jQuery(function() {
> var dates = jQuery('#from, #to').datepicker({
> defaultDate: '+1w',
> changeMonth: true,
> changeYear: true,
> dateFormat: 'dd-mm-yy',
> numberOfMonths: 1,
> onSelect: function(selectedDate) {
> var option = this.id == 'from' ? 'minDate' :
> 'maxDate';
> var instance =
> jQuery(this).data('datepicker');
> var date =
> djQuery.datepicker.parseDate(instance.settings.dateFormat ||
> jQuery.datepicker._defaults.dateFormat, selectedDate,
> instance.settings);
> dates.not(this).datepicker('option', option,
> date);
> }
> });
> });
> ",array('inline'=>false)); ?>
>
> <div class="projetos form">
> <?php echo $form->create('Projeto',array('type'=>'file'));?>
> <fieldset>
> // a lot of html here that i've ommited purposelly
> <table id="financiamentos">
> <thead>
> ...
> </thead>
> <tbody>
> ...
> </tbody>
> <tfoot>
> <td>
> <?php echo $html->link('Incluir
> Financiamento',
> array('controller'=>'orgaos','action'=>'incluirOrgao'), array('title'
> => 'Incluir Financiamento', 'onclick' => "Modalbox.show(this.href,
> {title: this.title, width: 400}); return false;")); ?>
> </td>
> </tfoot>
> </table>
> ...
> </fieldset>
> <?php echo $form->submit(__('Cadastrar',true), array('div' => true,
> 'class' => 'botao')); ?>
> <?php e($form->end()); ?>
> </div>
>
> inside modalbox
>
> <?php echo $html->css('modalbox/crud'); ?>
>
> <?php
> $javascript->codeBlock("
> jQuery(function(
> alert('funciona');
> ));
> ",array('inline'=>false)); // i've tried to put 'true' too
> ?>
>
> <?php
> echo $ajax->form('incluirOrgao', 'post', array(
> 'model' => 'Orgao',
> 'url' => array( 'controller' => 'orgaos', 'action' =>
> 'incluirOrgao'),
> 'update' => 'MB_content',
> 'complete' => "Modalbox.resizeToContent()"
> ));
> ?>
> <p class='modalp'>Preencha o campo abaixo com Nome, Sigla ou parte do
> Nome do Órgão e clique em Pesquisar</p>
> <p class='modalp'>
> <?php
> echo
> $form->input('palavras',array('type'=>'text','div'=>false,'label'=>''));
> echo $form-
> >button('pesquisar',array('type'=>'submit','id'=>'pesquisar','div'=>false,'value'=>'pesquisar'));
>
> ?>
> </p>
> <?php
> echo $form->end();
> ?>
> ...
>
> On 3 ago, 10:04, cricket <[email protected]> wrote:
>
> > On Mon, Aug 2, 2010 at 6:25 PM, Persivo Cunha <[email protected]> wrote:
> > > Hi, Everyone
>
> > > So, i have my modalbox working perfectly with cakephp, but when i put
> > > scripts (<script></scripts>) inside the page loaded by modalbox, they
> > > arent loaded. And i'd like to do that because i wanna use some jquery
> > > ui libraries inside modalbox. I've tried to use javascript-
> > >>codeBlock() and $javascript->link to load these libraries, but
> > > nothings works.
>
> > > How can i use these libraries inside modalbox?
>
> > Can you post the lines of code where you're trying to include it?
>
> > When the page loads, do you see the script tags in source? If so, are
> > the paths correct? o you use Firebug? If so, is it showing the code at
> > all? Maybe it's a JS problem.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en