Yii Framework Forum: CGridView update - Yii Framework Forum

Jump to content

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

CGridView update Rate Topic: -----

#1 User is offline   andser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 12-February 10

Posted 19 May 2010 - 07:46 AM

Hi!

I have JsTree :
<? $this->Widget('application.extensions.jsTree.CjsTree', array(
  'data'=>$folders,
  'ui'=>array('theme_name'=>'default'),
  'id'=>'folders',
  'rules'=>array(
    'droppable' => "tree-drop",
    'multiple' => true,
    'deletable' => "all",
    'draggable' => "all" 
  ),
  'callback'=>array(
.....
    "ondblclk"=>"js:function(NODE, TREE_OBJ) { refreshFilesGrid(NODE); }",
.....
  ),
)); ?>


And I have GridView :
<?
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'files-grid',
    'dataProvider'=>$files,
    'ajaxUpdate'=>true,
    'columns'=>array(
        array(
            'name'=>Yii::t('main', 'File name'),
            'value'=>'$data->name',
        ),
        array(
            'name'=>Yii::t('main', 'Date'),
            'value'=>'date("d-m-Y H:i:s", $data->uploaded)',
        ),
        array(
          'class'=>'CButtonColumn',
          'buttons'=>array(
            'update'=>array(
              'visible'=>'false'
              )
            )
        ),
    ),
));
?>


And refreshFilesGrid function :
<script type="text/javascript">
  function refreshFilesGrid(node)
  {
// Here is an javascript error showing: "$.param.querystring is not a function".
    $.fn.yiiGridView.update('files-grid', {
      type:'POST',
      url: 'ajax/getfiles/?folder_id'+node.id,
      success:function() {
       $.fn.yiiGridView.update('files-grid');
      }
    });
  }
</script>


When I double clicking on tree node I need refresh gridview. How to do it?

Thanks.
0

#2 User is offline   andser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 12-February 10

Posted 19 May 2010 - 10:41 AM

Tried to bind click to links in tree :
Yii::app()->clientScript->registerScript('xxx', "
$(\"a[href='#']\").click(function() {
  $.fn.yiiGridView.update('files-grid', {
    type:'POST',
    url:'/ajax/test',
    success:function() {
      $.fn.yiiGridView.update('files-grid');
    },
    failure:function() {
      alert('error');
    }
  });
  return false;
});
");


...but error '$.param.querystring is not a function' still showing :(
0

#3 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 20 May 2010 - 03:31 AM

$.param.querystring is called from the yiiGridView.update and is located in the jquery.ba-bbq.js

check your HTML source if you have the jquery.ba-bbq.js included...
Find more about me.... btw. Do you know your WAN IP?
0

#4 User is offline   reed1 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 23-June 10

Posted 13 July 2010 - 10:40 PM

View Postmdomba, on 20 May 2010 - 03:31 AM, said:

$.param.querystring is called from the yiiGridView.update and is located in the jquery.ba-bbq.js

check your HTML source if you have the jquery.ba-bbq.js included...


that's it , thank you very much !
0

#5 User is offline   MaheshMohan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 20-December 11

Posted 19 March 2012 - 01:49 AM

Seems reed1 has solved his issue. I have exactly same error and I've tried blocking and enabling "jquery.ba-bbq.js" and still the error presists.
0

#6 User is offline   phpguy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 24-April 11
  • Location:Myrtle Beach, SC

Posted 30 December 2012 - 05:07 PM

View PostMaheshMohan, on 19 March 2012 - 01:49 AM, said:

Seems reed1 has solved his issue. I have exactly same error and I've tried blocking and enabling "jquery.ba-bbq.js" and still the error presists.


If the jquery.ba-bbq.js is included then you may recreating the jQuery object after jquery.ba-bbq.js. E.g. jQuery is loaded more than once....
Life can only be understood backwards; but it must be lived forwards.
0

#7 User is offline   Pablo Aguila 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 06-June 14

Posted 12 June 2014 - 03:06 AM

Muchas Gracias! tambiƩn tenia problemas con esto!
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