My small improvements about yii2
##Please, attention!
These improvements use for YII2 Beta! @See https://github.com/kartik-v/yii2-widgets
Set the application language if provided by GET, session or cookie.
Rewrite from:
Added 'basePoint'
We should set new $basePoint instead of 'document' for jQuery selectors when we use Modal of Bootstrap with remote data.
For example '.modal-dialog'
Don't forget to write:
$('body').on('hidden.bs.modal', '.modal', function () {
$(this).removeData('bs.modal');
})
for clean remote data
Added only $secondRow. We use this if we need two rows in a header
Methods for
- header and body separately
- add additional (probably hidden) row
- several attributes into one column
- added $absent if we don't need data columns
- if we have list of attribute in a header [@see GridView]
Added $defaultSortAttribute. We can set default Sorting for all attributes
'attributes' => ['attribute1', 'attribute2'],
'labels' => ['Label1', 'Label2'],
Set in column for first level
'headerOptions' => [
'colspan' => '2',
],
Set in column for second level:
'headerOptions' => [
'secondRow' => true,
],
For other columns:
'headerOptions' => [
'rowspan' => '2',
],
Don't forget set for column if needed:
'class' => 'common\components\grid\SerialColumn',
'fixedHeader' => true,
'fixedHeaderTemplate' => '<div><div>{header}</div></div><div>{body}</div>',
If we have use additional (probably hidden) row:
'afterRow' => ['\common\components\grid\GridView', 'renderTableOtherRow'],
'otherRowOptions' => [
'style' => 'display: none',
],
And then additional rows after 'columns' => [...]
'otherRowColumns' => [...]