Yii Framework Forum: Cants See A Popup - Yii Framework Forum

Jump to content

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

Cants See A Popup bootstrap.widgets.TbButton Rate Topic: -----

#1 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 11 February 2014 - 01:28 PM

I downloaded the bootstrap extension and jss files from www.getbootstrap.com

Then, I placed the extracted files in the extension/bootstrap directory

Below you find the sample code of the config file:

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),


I am using the Abound theme , and I changed the main.php in the layout as below and registered the CSS Files

<?php
$baseUrl = Yii::app()->theme->baseUrl;
$cs = Yii::app()->getClientScript();
Yii::app()->clientScript->registerCoreScript('jquery');
?>
<!-- Fav and Touch and touch icons -->
<link rel="shortcut icon" href="<?php echo $baseUrl;?>/img/icons/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-57-precomposed.png">
<?php

$cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.css');
$cs->registerCssFile($baseUrl.'/css/bootstrap.min.css');
$cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.min.css');
$cs->registerCssFile($baseUrl.'/css/abound.css');

Yii::app()->bootstrap->registerAllCss();
//$cs->registerCssFile($baseUrl.'/css/style-blue.css');
?>
<!-- styles for style switcher -->
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/css/style-blue.css" />

<?php
$cs->registerScriptFile($baseUrl.'/js/bootbox.js');
$cs->registerScriptFile($baseUrl.'/js/bootstrap.js');
$cs->registerScriptFile($baseUrl.'/js/bootstrap.min.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.sparkline.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.min.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.pie.min.js');
$cs->registerScriptFile($baseUrl.'/js/charts.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.knob.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.masonry.min.js');
$cs->registerScriptFile($baseUrl.'/js/styleswitcher.js');
// Yii::app()->bootstrap->register();
?>



Now, if I use the following code :

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on left
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on top
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus
sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on bottom
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on right
</button>

it doesnot show me any popovers!!!

Whats that I am missing?

This post has been edited by Sachy: 12 February 2014 - 06:01 AM

0

#2 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 12 February 2014 - 08:17 AM

Anyone can please help me out? I know it might be a simple solution. but I am really stuck on it :(


View PostSachy, on 11 February 2014 - 01:28 PM, said:

I downloaded the bootstrap extension and jss files from www.getbootstrap.com

Then, I placed the extracted files in the extension/bootstrap directory

Below you find the sample code of the config file:

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),


I am using the Abound theme , and I changed the main.php in the layout as below and registered the CSS Files

<?php
$baseUrl = Yii::app()->theme->baseUrl;
$cs = Yii::app()->getClientScript();
Yii::app()->clientScript->registerCoreScript('jquery');
?>
<!-- Fav and Touch and touch icons -->
<link rel="shortcut icon" href="<?php echo $baseUrl;?>/img/icons/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo $baseUrl;?>/img/icons/apple-touch-icon-57-precomposed.png">
<?php

$cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.css');
$cs->registerCssFile($baseUrl.'/css/bootstrap.min.css');
$cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.min.css');
$cs->registerCssFile($baseUrl.'/css/abound.css');

Yii::app()->bootstrap->registerAllCss();
//$cs->registerCssFile($baseUrl.'/css/style-blue.css');
?>
<!-- styles for style switcher -->
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/css/style-blue.css" />

<?php
$cs->registerScriptFile($baseUrl.'/js/bootbox.js');
$cs->registerScriptFile($baseUrl.'/js/bootstrap.js');
$cs->registerScriptFile($baseUrl.'/js/bootstrap.min.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.sparkline.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.min.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.pie.min.js');
$cs->registerScriptFile($baseUrl.'/js/charts.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.knob.js');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.masonry.min.js');
$cs->registerScriptFile($baseUrl.'/js/styleswitcher.js');
// Yii::app()->bootstrap->register();
?>



Now, if I use the following code :

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on left
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on top
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus
sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on bottom
</button>

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on right
</button>

it doesnot show me any popovers!!!

Whats that I am missing?


0

#3 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,701
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 12 February 2014 - 08:56 AM

If you're using any bootstrap extension make sure it was updated to BS 3.1. Syntax of BS was changed slightly.
Also make sure there are no js errors.
God is real unless declared as integer
0

#4 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 12 February 2014 - 09:48 AM

View PostORey, on 12 February 2014 - 08:56 AM, said:

If you're using any bootstrap extension make sure it was updated to BS 3.1. Syntax of BS was changed slightly.
Also make sure there are no js errors.


Thanks Orey.

I already downloaded :/v3.1.0/bootstrap-3.1.0-dist.zip

Copied them to \protected\extensions\bootstrap directory.

And again I checked if I got any Jscript error.

I didnt get any Jscript error, but I got this warning below.
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

The popover is very well demonstrated here :getbootstrap.com/javascript/#popovers

but I want it to be working in my code as well!

When I click on the button, nothing happens!

0

#5 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,701
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 12 February 2014 - 10:38 AM

Take a look here:
$cs->registerScriptFile($baseUrl.'/js/bootstrap.js');

and here:
$cs->registerScriptFile($baseUrl.'/js/bootstrap.min.js');

and I'm pretty sure another one is registered by
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),

and what's this btw:
$cs->registerScriptFile($baseUrl.'/js/bootbox.js');


So please, get rid of unneeded code and start with a clean template.
God is real unless declared as integer
0

#6 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 12 February 2014 - 11:29 AM

Thanks Again ORey! I made the following changes :

<?php

//$cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.css');
// $cs->registerCssFile($baseUrl.'/css/bootstrap.min.css');
// $cs->registerCssFile($baseUrl.'/css/bootstrap-responsive.min.css');
$cs->registerCssFile($baseUrl.'/css/abound.css');

Yii::app()->bootstrap->registerAllCss();
//$cs->registerCssFile($baseUrl.'/css/style-blue.css');
?>
<!-- styles for style switcher -->
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/css/style-blue.css" />

<?php
$cs->registerScriptFile($baseUrl.'/js/bootbox.js');
$cs->registerScriptFile($baseUrl.'/js/bootstrap.js');
// $cs->registerScriptFile($baseUrl.'/js/bootstrap.min.js');
// $cs->registerScriptFile($baseUrl.'/js/plugins/jquery.sparkline.js');
//$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.min.js');
//$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.flot.pie.min.js');
//$cs->registerScriptFile($baseUrl.'/js/charts.js');
//$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.knob.js');
//$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.masonry.min.js');
//$cs->registerScriptFile($baseUrl.'/js/styleswitcher.js');
// Yii::app()->bootstrap->register();
?>

This time, I saw that the modal dialog works !!! But still the popover doesnot work .'

Bootbox.js was downloaded from bootboxjs.com

But I am still not sure , if I got what I did to make it work...

Thanks!
Sachy


View PostORey, on 12 February 2014 - 10:38 AM, said:

Take a look here:
$cs->registerScriptFile($baseUrl.'/js/bootstrap.js');

and here:
$cs->registerScriptFile($baseUrl.'/js/bootstrap.min.js');

and I'm pretty sure another one is registered by
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),

and what's this btw:
$cs->registerScriptFile($baseUrl.'/js/bootbox.js');


So please, get rid of unneeded code and start with a clean template.

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