mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-13 22:06:51 +08:00
@ -102,7 +102,7 @@ echo ListView::widget([
|
||||
GridView <a name="grid-view"></a>
|
||||
--------
|
||||
|
||||
データグリッドすなわち [[yii\widgets\GridView|GridView]] は Yii の最も強力なウィジェットの一つです。
|
||||
データグリッドすなわち [[yii\grid\GridView|GridView]] は Yii の最も強力なウィジェットの一つです。
|
||||
これは、システムの管理セクションを素速く作らねばならない時に、この上なく便利なものです。
|
||||
このウィジェットは [データプロバイダ](output-data-providers.md) からデータを受けて、テーブルの形式で、行ごとに一組の [[yii\grid\GridView::columns|カラム]] を使ってデータを表示します。
|
||||
|
||||
@ -691,11 +691,11 @@ echo GridView::widget([
|
||||
### GridView を Pjax とともに使う
|
||||
|
||||
[[yii\widgets\Pjax|Pjax]] ウィジェットを使うと、ページ全体をリロードせずに、ページの一部分だけを更新することが出来ます。
|
||||
これを使うと、フィルタを使うときに、[[yii\widgets\GridView|GridView]] の中身だけを更新することが出来ます。
|
||||
これを使うと、フィルタを使うときに、[[yii\grid\GridView|GridView]] の中身だけを更新することが出来ます。
|
||||
|
||||
```php
|
||||
use yii\widgets\Pjax;
|
||||
use yii\widgets\GridView;
|
||||
use yii\grid\GridView;
|
||||
|
||||
Pjax::begin([
|
||||
// PJax のオプション
|
||||
@ -707,8 +707,8 @@ Pjax::end();
|
||||
```
|
||||
|
||||
[[yii\widgets\Pjax|Pjax]] は、[[yii\widgets\Pjax::$linkSelector|Pjax::$linkSelector]] の指定に従って、リンクに対しても動作します。
|
||||
これは [[yii\data\ActionColumn|ActionColumn]] を使う場合には問題となり得ます。
|
||||
この問題を防止するためには、[[yii\data\ActionColumn::$buttons|ActionColumn::$buttons]]
|
||||
これは [[yii\grid\ActionColumn|ActionColumn]] を使う場合には問題となり得ます。
|
||||
この問題を防止するためには、[[yii\grid\ActionColumn::$buttons|ActionColumn::$buttons]]
|
||||
プロパティを編集して `data-pjax="0"` という HTML 属性を追加します。
|
||||
|
||||
#### Gii における Pjax を伴う GridView
|
||||
@ -721,7 +721,7 @@ yii gii/crud --controllerClass="backend\\controllers\PostController" \
|
||||
--enablePjax=1
|
||||
```
|
||||
|
||||
これによって、[[yii\widgets\GridView|GridView]] または [[yii\widgets\ListView|ListView]]
|
||||
これによって、[[yii\grid\GridView|GridView]] または [[yii\widgets\ListView|ListView]]
|
||||
を囲む [[yii\widgets\Pjax|Pjax]] ウィジェットが生成されます。
|
||||
|
||||
|
||||
|
@ -701,11 +701,11 @@ echo GridView::widget([
|
||||
|
||||
The [[yii\widgets\Pjax|Pjax]] widget allows you to update a certain section of a
|
||||
page instead of reloading the entire page. You can use it to to update only the
|
||||
[[yii\widgets\GridView|GridView]] content when using filters.
|
||||
[[yii\grid\GridView|GridView]] content when using filters.
|
||||
|
||||
```php
|
||||
use yii\widgets\Pjax;
|
||||
use yii\widgets\GridView;
|
||||
use yii\grid\GridView;
|
||||
|
||||
Pjax::begin([
|
||||
// PJax options
|
||||
@ -718,9 +718,9 @@ Pjax::end();
|
||||
|
||||
Pjax also works for the links inside the [[yii\widgets\Pjax|Pjax]] widget and
|
||||
for the links specified by [[yii\widgets\Pjax::$linkSelector|Pjax::$linkSelector]].
|
||||
But this might be a problem for the links of an [[yii\data\ActionColumn|ActionColumn]].
|
||||
But this might be a problem for the links of an [[yii\grid\ActionColumn|ActionColumn]].
|
||||
To prevent this, add the HTML attribute `data-pjax="0"` to the links when you edit
|
||||
the [[yii\data\ActionColumn::$buttons|ActionColumn::$buttons]] property.
|
||||
the [[yii\grid\ActionColumn::$buttons|ActionColumn::$buttons]] property.
|
||||
|
||||
#### GridView/ListView with Pjax in Gii
|
||||
|
||||
@ -734,7 +734,7 @@ yii gii/crud --controllerClass="backend\\controllers\PostController" \
|
||||
```
|
||||
|
||||
Which generates a [[yii\widgets\Pjax|Pjax]] widget wrapping the
|
||||
[[yii\widgets\GridView|GridView]] or [[yii\widgets\ListView|ListView]] widgets.
|
||||
[[yii\grid\GridView|GridView]] or [[yii\widgets\ListView|ListView]] widgets.
|
||||
|
||||
Further reading
|
||||
---------------
|
||||
|
Reference in New Issue
Block a user