title: Yii Gridview Error Typeerror: Jquery(...).popover Is Not A Function [Break On This Error] Jquery('[Data-Toggle=Popover]').popover();
body: <p>I'm having an error with gridview update, sorting, paging. The grid is loaded fine via AJAX upon page load. But upon clicking the thead to sort the row, or upon clicking any of the pagination button I get an error saying:</p>
  
  <pre><code>    Uncaught TypeError: Object [object Object] has no method 'popover'
  jQuery.yiiGridView.afterAjaxUpdate
  $.extend.success
  fire
  self.fireWith
  done
  callback
  </code></pre>
  
  <p>and in Firebug I'm getting:</p>
  
  <pre><code>TypeError: jQuery(...).popover is not a function
  </code></pre>
  
  <p>[Break On This Error]   </p>
  
  <p>jQuery('[data-toggle=popover]').popover();</p>
  
  <p>This is pointing to this piece of code:</p>
  
  <pre><code>    /*&lt;![CDATA[*/
  jQuery('#yw0').yiiGridView({'ajaxUpdate':['yw0'],'ajaxVar':'ajax','pagerClass':'pagination','loadingClass':'grid-view-loading','filterClass':'filters','tableClass':'tablehead table table-paper table-condensed table-striped table-sortable table','selectableRows':1,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'RealTime_page','afterAjaxUpdate':function() {
  jQuery('.popover').remove();
  jQuery('[data-toggle=popover]').popover();
  jQuery('.tooltip').remove();
  jQuery('[data-toggle=tooltip]').tooltip();
  }});
  /*]]&gt;*/
  </code></pre>
  
  <p>I tried to solve the problem by including bootstrap.tooltip.js and bootstrap.popover.js additionally but I'm still getting the same error.</p>
  
  <p>Here is the part where all the scripts are included:</p>
  
  <pre><code>&lt;!-- start: JavaScript--&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-1.10.2.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-migrate-1.0.0.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap-tooltip.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap-popover.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-ui-1.10.0.custom.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.ui.touch-punch.js"&gt;&lt;/script&gt;
  
  
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.cookie.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/fullcalendar.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/excanvas.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.min.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.pie.min.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.stack.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.resize.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.chosen.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.uniform.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.cleditor.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.noty.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.elfinder.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.raty.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.iphone.toggle.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.uploadify-3.1.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.gritter.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.imagesloaded.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.masonry.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.knob.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.sparkline.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/custom.js"&gt;&lt;/script&gt;
  
      &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/28e7347b/jquery.ba-bbq.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/28e7347b/jquery.ajaxqueue.js"&gt;&lt;/script&gt;
      &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/dd5f9a70/gridview/jquery.yiigridview.js"&gt;&lt;/script&gt;
  
  
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the controller that is rendering the view:</p>
  
  <pre><code>public function actionUpdateProductData() {
  Yii::import('application.components.DataScraper.*');
  require_once('GetProductData.php');
  
  $productRealTime = RealTime::model()-&gt;findAll();
  
  if (isset($_GET['RealTime'])) {
          $productRealTime-&gt;attributes = $_GET['RealTime'];
      }
  
  if (count($productRealTime-&gt;model()-&gt;findAll()) === 0) {
  
      $symbolData = new GetProductData();
      $symbolData-&gt;getAmazonProductData();
  } else {
  
  
      echo CJSON::encode( array(
          'status' =&gt; 'OK',
          'div' =&gt; $this-&gt;renderPartial('_productDataGrid', array(
                          'model' =&gt; $productRealTime), 
                          true, true ),
      ));
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and here is the view _productDataGrid.php:</p>
  
  <pre><code>  &lt;?php
  
  $this-&gt;widget('bootstrap.widgets.TbGridView', array(
      'id' =&gt; 'real-time-grid',
      'dataProvider' =&gt; $model-&gt;search(),
      'filter' =&gt; $model,
      'columns' =&gt; array(
          'id',
          'name',
          'category',
          'price'
          'rating'
  
  
      ),
  ));
  ?&gt;
  </code></pre>
  
  <p>and here is index.php:</p>
  
  <pre><code>&lt;div&gt;
  &lt;hr&gt;
  &lt;ul class="breadcrumb"&gt;
      &lt;li&gt;
          &lt;a href="#"&gt;Home&lt;/a&gt; &lt;span class="divider"&gt;/&lt;/span&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="#"&gt;Stock Info&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  &lt;hr&gt;
  </code></pre>
  
  <p></p>
  
  
  
      
  
      
  
  
  
  baseUrl;
          $cs = Yii::app()->getClientScript();
  
          $cs->registerScriptFile($baseUrl . '/js/ajaxProductDataUpdate.js', CClientScript::POS_END);
  
  ?>
  
  <p>Last of all Here is the ajaxProductDataUpdate.js</p>
  
  <pre><code>    var productParameters = {
      ajaxUpdate: function() {
          $.ajax({
              url: "/ProductAnalysis/index.php/realTime/updateProductData",
              type: "GET",
              dataType:"json",
              error: function(xhr, tStatus, e) {
                  if (!xhr) {
                      alert(" We have an error ");
                      alert(tStatus + "   " + e.message);
                  } else {
                      alert("else: " + e.message); // the great unknown
                  }
              },
              success: function(data) {
                  $.fn.yiiGridView.update('real-time-grid', {
                      data: $(this).serialize()
                  });
              }
          });
      }
  };
  
  $(document).ready(function() {
      productParameters.ajaxUpdate();
  
  });
  </code></pre>
  
  <p>I just don't know what to do to fix the error. And I need to use gridview badly, in my case... Please provide any help on how to fix the error.</p>
  
  <p>Thanks,</p>
  
  <p>Maxx </p>