How to remove summary text In yii2?

10,112

Solution 1

The best way to do this is to override the layout of the gridView widget. By default, the widget will generate a layout based on this pattern; {summary}\n{items}\n{pager}. You can control over what appears in the widget like this;

echo GridView::widget([
   'dataProvider' => $dataProvider,
   'filterModel' => $searchModel,
   'layout' => '{items}\n{pager}',
   'columns' => [
    // ...
      ],
]);

Solution 2

In gridview options set summary to NULL

echo GridView::widget([
   'dataProvider' => $dataProvider,
   'filterModel' => $searchModel,
   'summary' => '',
   'columns' => [
    // ...
      ],
]);

Solution 3

In your grid view , use summary as empty:

   echo GridView::widget([
   'dataProvider' => $dataProvider,
   'filterModel' => $searchModel,
   'summary' => '',

]);

For more options of grid view check this link click here...

Share:
10,112
Priyanka Ahire
Author by

Priyanka Ahire

I am Priyanka Ahire. I have 5 years of experience as Developer. Currently Working on angular 2, 4, 6, 8, JavaScript, Ionic, NodeJs, CSS, SASS, Jquery, HTML

Updated on June 14, 2022

Comments

  • Priyanka Ahire
    Priyanka Ahire almost 2 years

    enter image description here

    I want to remove the line which is show in attached screen shot from my page.How can I edit this from my yii2 project

  • German Khokhlov
    German Khokhlov about 6 years
    Pay attention that \n needs double quotes.