Example #1
0
<?php

$this->breadcrumbs = array('Bukus' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Buku', 'url' => array('index')), array('label' => 'Create Buku', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('buku-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Manajemen Buku</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button btn'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'buku-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'judul', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->judul), $data->id)'), array('name' => 'kategori', 'type' => 'raw', 'value' => 'Kategori::getKategori($data->kategori)', 'filter' => Kategori::getNama()), array('class' => 'bootstrap.widgets.TbButtonColumn'))));