<?php
/**
 * Created by PhpStorm.
 * User: antonpauli
 * Date: 29.11.13
 * Time: 11:43
 */



$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'last-contact-grid',
    'type'=>'',
    'dataProvider'=>$dataProvider,
    'template'=>"{items}{pager}",
    'ajaxUrl' => url('addressbookAddresses/default/lastContact'),
    'beforeAjaxUpdate' => 'function(id,options){console.log(id);console.log(options);options.url+="&id="+$("#Addresses_id").val()}',
    'columns'=>array(
        array(
            'name'=>'typ',
            'header' => __('UCITEM_HISTORY_TYPE'),
            'headerHtmlOptions'=>array('data-translation-id'=>'UCITEM_HISTORY_TYPE'),
            'type' => 'raw',
            'value' => 'Yii::app()->controller->renderHistoryTypeCell($data, $row)'
        ),
        array(
            'type' => 'raw',
            'name'=>'timestamp',
            'header' => __('UCITEM_HISTORY_TIMES'),
            'headerHtmlOptions'=>array('data-translation-id'=>'UCITEM_HISTORY_TIMES'),
            'value' => 'Yii::app()->controller->renderHistorySummaryCell($data, $row)'
        ),
        array(
            'type' => 'raw',
            'name'=>'remote_number',
            'header' => __('UCITEM_REMOTE_NUMBER'),
            'headerHtmlOptions'=>array('data-translation-id'=>'UCITEM_REMOTE_NUMBER'),
            'value' => '$data->getRemoteNumber()'
        ),
        array(
            'name'=>'note',
            'type' => 'raw',
            'header' => "<div class='noWordBreak'>".__('UCITEM_MODEL_NOTE')."</div>",
            'headerHtmlOptions'=>array('data-translation-id'=>'UCITEM_MODEL_NOTE'),
        ),
        //array('name'=>'firstName', 'header'=>'First name'),
        //array('name'=>'lastName', 'header'=>'Last name'),
        //array('name'=>'language', 'header'=>'Language'),

    ),
));