Yii Framework Forum: Boostrap Modal Remote Url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Boostrap Modal Remote Url Rate Topic: -----

#1 User is offline   pod2g 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 20-May 12

Posted 10 January 2013 - 09:05 PM

1stly, i like to thanks for such a great ext !

Here I am trying to archive calling remote url in modal popup. I am searching around and have not found an good link to go...

In twitter boostrap document state:

Quote

"if a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:
<a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>".



But i failed to load my url (create form) while i do in yii boostrap ext below is my code:

<?php $this->beginWidget('bootstrap.widgets.TbModal', array('id'=>'myModal')); ?>
<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4>Modal header</h4>
</div>
<div class="modal-body">
    <p> Modal body </p>
</div>
<div class="modal-footer">
    <?php $this->widget('bootstrap.widgets.TbButton', array(
        'type'=>'primary',
        'label'=>'Save changes',
    )); ?>
</div> 
<?php $this->endWidget(); ?>

<?php $this->widget('bootstrap.widgets.TbButton', array(
    'label'=>'New Project',
    'type'=>'primary',
    'url'=>$this->createUrl('create'), // My Remote URL
    'htmlOptions'=>array(
        'data-toggle'=>'modal',
        'data-target'=>'#myModal',
     ), 
)); ?>


Appreciate any help.

Regards,
pod2g
0

#2 User is offline   lehandr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 17-June 11
  • Location:Kharkov, Ukraine

Posted 18 March 2013 - 02:49 AM

This is I found: http://stackoverflow...ntent-everytime

This is my decision:
$(document).on('click','a[data-toggle=modal]', function() {
	event.preventDefault();
	var $modal=$($(this).data('target'));

	$('.modal-body',$modal).empty();
	$modal.show();
	$('.modal-body',$modal).load($(this).attr('href'));
});

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users