table disappears after sort or filter action


(Mr9847) #1

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?


(Rhf1898) #2

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.


(Mr9847) #3

what is pajax? I have nothing specified like that.


(Rhf1898) #4

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.


(Mr9847) #5

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?


(Mr9847) #6

and what do I do to disable Ajax?


(Rhf1898) #7

In gridview put the option:




$this->widget('zii.widgets.grid.CGridView', array(

	'id' => 'my-id',	

	'filter' => $model,

	'ajaxUpdate' => false,    //<-- this option

	'dataProvider' => $dataProvider,	

        ...

));




(Rhf1898) #8

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',

                ),

            )

         )




(Mr9847) #9

How do I look at the standard log?


(Rhf1898) #10



               /* 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.


(Mr9847) #11

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


(Mr9847) #12

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" />