Yii Framework Forum: urgent gridview order - Yii Framework Forum

Jump to content

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

urgent gridview order Rate Topic: -----

#1 User is offline   moholh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 03-June 16

Posted 27 April 2017 - 09:08 AM

hello everybody.
I want to save url of curent order grid view with ajax call but ajax function reload the full page I want just to relaod grid as usual please help me thanks.

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'compte-grid',
	'dataProvider'=>$model->search(),
'columns'=>array(
  array('name' => 'datesession', 'value' => '$data->getDateSession()',  'htmlOptions'=>array('style'=>'width: 13%;')),
)));?>

and this is ajx call function
$('#compte-grid  a').click(function(e) {
	  e.preventDefault();
		var link = $(this).attr('href');
        var uri="<?php echo $_SERVER["REQUEST_URI"];?>";
        $.ajax({
            type:"POST",
            data:{'uri':uri},
            dataType:'JSON',
            url:"<?php echo Yii::app()->createUrl('compte/saveURI'); ?>",
            complete : function(response){
                 window.location.href = link; // <-- This line 
            }
        });
    });

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