Yii Framework Forum: table disappears after sort or filter action - Yii Framework Forum

Jump to content

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

table disappears after sort or filter action Rate Topic: -----

#1 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 01 June 2018 - 09:40 AM

I create a view with table with filtering and sorting enabled. I've done this many times and have never encountered the following symptom. When I click on a header to sort, or enter a string to filter a column, the table completely disappears. Usually, you would expect no change to the table or "No results." below the table headers. The table completely disappears. I've combed my controller action and search function and cannot determine what might be causing this phenomenon. The view paints fine, has some menus to process via _POST, and all that works fine. It's just the sorting or filtering functions that cause the table to disappear. Any ideas why?
0

#2 User is offline   rahif 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 293
  • Joined: 11-July 13

Posted 01 June 2018 - 09:52 AM

hi,
remove pajax from the table. Now, do the same Sorting or filtering and you'll see the error.
Correct the error and put pajax again.
0

#3 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 01 June 2018 - 03:31 PM

View Postrahif, on 01 June 2018 - 09:52 AM, said:

hi,
remove pajax from the table. Now, do the same Sorting or filtering and you'll see the error.
Correct the error and put pajax again.



what is pajax? I have nothing specified like that.
0

#4 User is offline   rahif 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 293
  • Joined: 11-July 13

Posted 03 June 2018 - 11:55 AM

pajax is a jquery used for managed ajax request in yii2.0, I supose ajax was the problem.
(I saw this post in section Yii2.0 :huh: )
Work without ajax (temporarily), enable logs and search for errors.
Sorry for misunderstanding.
0

#5 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 05 June 2018 - 10:58 AM

View Postrahif, on 03 June 2018 - 11:55 AM, said:

pajax is a jquery used for managed ajax request in yii2.0, I supose ajax was the problem.
(I saw this post in section Yii2.0 :huh: )
Work without ajax (temporarily), enable logs and search for errors.
Sorry for misunderstanding.



How do I enable logs? I don't receive any visible errors in the view.

Also I tried my view with IE, FF and Chrome on both Solaris and Linux. When I sort or filter a column in my view on Solaris, Chrome and FF work correctly, but on IE, the entire table (including the headers and filter boxes) disappears. When I sort or filter a column in my view on Linux, Chrome and FF report No Results under the table headers and the table disappears on IE (all three are incorrect).

So how do I enable logs?
0

#6 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 05 June 2018 - 11:06 AM

View PostMaryR, on 05 June 2018 - 10:58 AM, said:

How do I enable logs? I don't receive any visible errors in the view.

Also I tried my view with IE, FF and Chrome on both Solaris and Linux. When I sort or filter a column in my view on Solaris, Chrome and FF work correctly, but on IE, the entire table (including the headers and filter boxes) disappears. When I sort or filter a column in my view on Linux, Chrome and FF report No Results under the table headers and the table disappears on IE (all three are incorrect).

So how do I enable logs?


and what do I do to disable Ajax?
0

#7 User is offline   rahif 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 293
  • Joined: 11-July 13

Posted 05 June 2018 - 12:45 PM

View PostMaryR, on 05 June 2018 - 11:06 AM, said:

and what do I do to disable Ajax?


In gridview put the option:
$this->widget('zii.widgets.grid.CGridView', array(
	'id' => 'my-id',	
	'filter' => $model,
	'ajaxUpdate' => false,    //<-- this option
	'dataProvider' => $dataProvider,	
        ...
));

0

#8 User is offline   rahif 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 293
  • Joined: 11-July 13

Posted 05 June 2018 - 12:56 PM

View PostMaryR, on 05 June 2018 - 10:58 AM, said:

How do I enable logs? I don't receive any visible errors in the view.

then logs probable will be empty.
In any case in config/main.php
        ...
        'charset' => 'utf-8',
 	'preload' => array('log'),  <-- 
        ...

	'db' => array(
           ...
	),
	'log' => array(
           'class' => 'CLogRouter',
            'routes' => array(
                array(   // ---> you use the standar log.
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
            )
         )

0

#9 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 05 June 2018 - 03:31 PM

View Postrahif, on 05 June 2018 - 12:56 PM, said:

then logs probable will be empty.
In any case in config/main.php
        ...
        'charset' => 'utf-8',
 	'preload' => array('log'),  <-- 
        ...

	'db' => array(
           ...
	),
	'log' => array(
           'class' => 'CLogRouter',
            'routes' => array(
                array(   // ---> you use the standar log.
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
            )
         )




How do I look at the standard log?
0

#10 User is offline   rahif 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 293
  • Joined: 11-July 13

Posted 06 June 2018 - 10:16 AM

               /* array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',  //choose one or more
                ),*/
                /*array(
			'class'=>'CWebLogRoute',
			'levels'=>'error, warning, trace, profile, info', //choose one or more
		),*/

the first write logs in a file (I think in protected/runtime/app.log)
the second show logs in web browser.

you can find others in Yii web site, extensions.
0

#11 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 06 June 2018 - 01:31 PM

thank you! will play with this to see if I see anything indicating why the table completely disappears
0

#12 User is offline   MaryR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 13-November 15

Posted 08 June 2018 - 09:35 AM

FYI: Nothing showed up in either log, but a peer suggested that I add the statement below to views/layouts/main.php and it fixed the problem. It was an obscure IE incompatibility that had not reared it's ugly head in any other of the dozens of views we have. This view has a relatively simple query and layout, so it's a mystery what the incompatibility was, but this is what I added to main.php to solve the issue of the disappearing table:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
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