Structures_DataGrid::fill

Structures_DataGrid::fill() – レンダリングコンテナにデータを投入する

Synopsis

require_once 'Structures/DataGrid.php';

mixed Structures_DataGrid::fill ( object &$container , array $options = array() , string $type = = null )

Description

This package is not documented yet.

Parameter

object &$container

サポートしている型 (例: HTML_Table オブジェクトや Spreadsheet_Excel_Writer オブジェクトなど) のコンテナ。

array $options

対応するレンダリングドライバへのオプション。

string $type

コンテナの型を検出できない場合に明示的に指定する型。

Return value

true あるいは PEAR_Error オブジェクトを返します。

Throws

例外はスローされません。

Pager オブジェクトの投入

<?php

require_once 'Pager/Pager.php';

// オプションを指定して Pager オブジェクトを作成します
$pager =& Pager::factory($options);

// データおよび設定にもとづいて fill() が $pager オブジェクトを設定します
$datagrid->fill($pager);

// ページ指定のリンクを作成します
echo $pager->links;

// あるいはお好みに応じて select フィールドを作成します
echo $pager->getpageselectbox();

?>

並べ替え機能つきのフォーム

<?php
require_once 'HTML/QuickForm.php';

// 設定情報をもとに空のフォームを作成します
$form = new HTML_QuickForm('myForm''POST');

// それをカスタマイズします。見出しを追加したり、テキストフィールドを追加したり……
$form->addElement('header'null'Search & Sort Form Example');
$form->addElement('text''my_search''Search for:');

// データグリッドに並べ替え用のフィールドを追加します。ラジオボタン型です
$options = array('directionStyle' => 'radio');
$datagrid->fill($form$options'HTMLSortForm');

// 送信ボタンを追加する必要があります。fill() はこれを追加しません
$form->addElement('submit'null'Submit');

// HTML_QuickForm::display() を使用してフォームを表示します
$form->display();

?>

Note

This function can not be called statically.

データソースからの読み込み、レンダラへの書き出しの際のストリーミング機能を有効にし、 バッファの大きさ (レコード数) を設定する (Previous) フィールドリストのカラムを生成する (Next)
Last updated: Fri, 25 May 2012 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.