Skip to content

Commit

Permalink
Fixed issue: Extend/Compact switcher for responses list wasn't workin…
Browse files Browse the repository at this point in the history
…g anymore
  • Loading branch information
LouisGac committed Aug 24, 2016
1 parent 9001132 commit 8be6d42
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
7 changes: 4 additions & 3 deletions application/controllers/admin/responses.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ private function _getData($params)
}

public function getActionParams()
{
return array_merge($_GET,$_POST);
}
{
return array_merge($_GET,$_POST);
}

public function viewbytoken($iSurveyID, $token, $sBrowseLang = '')
{
Expand Down Expand Up @@ -379,6 +379,7 @@ public function index($iSurveyID)
*/
public function set_grid_display()
{
var_dump($_POST['state']);
if (Yii::app()->request->getPost('state')=='extended')
{
Yii::app()->user->setState('responsesGridSwitchDisplayState','extended');
Expand Down
1 change: 0 additions & 1 deletion application/views/admin/responses/listResponses_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</label>
<?php
$state = Yii::app()->user->getState('responsesGridSwitchDisplayState') == "" ? 'compact' : Yii::app()->user->getState('responsesGridSwitchDisplayState');
var_dump($state);
$this->widget('yiiwheels.widgets.buttongroup.WhButtonGroup',
array(
'name' => 'display-mode',
Expand Down
17 changes: 8 additions & 9 deletions scripts/admin/listresponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@ $(document).ready(function(){

$('#display-mode').click(function(event){
event.preventDefault();
$that = $(this);
$actionUrl = $(this).data('url');
$display = $that.find('input').val();
$postDatas = {state:$display};

var $that = $(this);
var $actionUrl = $(this).data('url');
var $display = $that.find('input:not(:checked)').val();
var $postDatas = {state:$display};

$.ajax({
url : encodeURI($actionUrl),
url : encodeURI($actionUrl),
type : 'POST',
data : $postDatas,

// html contains the buttons
success : function(html, statut){
$.fn.yiiGridView.update('responses-grid', {
success: function(s){
}
});
location.reload();
},
error : function(html, statut){
console.log(html);
Expand Down

0 comments on commit 8be6d42

Please sign in to comment.