Yii Framework Forum: Number in cgridview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Number in cgridview Number in cgridview

#1 User is offline   Yunusov Mubin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-December 13

Posted 30 December 2016 - 01:41 AM

I use this extension http://www.yiiframew...ion/eexcelview/
for unloading in excel. Place the serial number I have is ID. Excellent Works.
$this->widget('EExcelView', array(
    'id'=>'ipconfig-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model, 
    'title'=>'IP Адреса',
    'autoWidth'=>true,
    'template'=>"{summary}\n{items}\n{exportbuttons}\n{pager}",
    'columns'=>array(
        array(
            'name'=>'id',
            'header'=>'№',
            'htmlOptions'=>array('style'=>'width: 25px; text-align: center;'),
        ),
        array(
            'name'=>'ip',
            'htmlOptions'=>array('width'=>'70px'),
        ),
        .......




But I wish that instead of standing ID number. And for that, I will do so:

$this->widget('EExcelView', array(
    'id'=>'ipconfig-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model, 
    'title'=>'IP Адреса',
    'autoWidth'=>true,
    'template'=>"{summary}\n{items}\n{exportbuttons}\n{pager}",
    'columns'=>array(
        array(
            'name'=>'id',
            'header'=>'№',
            'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
            'htmlOptions'=>array('style'=>'width: 25px; text-align: center;'),
        ),
        array(
            'name'=>'ip',
            'htmlOptions'=>array('width'=>'70px'),
        ),
        .......

This happened in excell upload does not work and displayed an error:

CException

Не определено свойство "EExcelView.grid".

D:\Mysites\devices\framework\base\CComponent.php(612) : eval()'d code(1)

How to solve this problem? Thank you.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users