Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

CGridView update

$
0
0
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.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>