DataColumn.php 591 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2016-03-21 18:46
  7. */
  8. namespace backend\grid;
  9. /**
  10. * @inheritdoc
  11. */
  12. class DataColumn extends \yii\grid\DataColumn
  13. {
  14. public $headerOptions = [];
  15. public $width = '60px';
  16. public $contentOptions = ['style' => 'word-wrap: break-word; word-break: break-all;'];
  17. /**
  18. * @inheritdoc
  19. */
  20. public function init()
  21. {
  22. parent::init();
  23. if (! isset($this->headerOptions['width'])) {
  24. $this->headerOptions['width'] = $this->width;
  25. }
  26. }
  27. }