Skip to content

Commit b7241e4

Browse files
author
Simkin, Maksim
committed
apply extraStyle property to give possibility to change style of dedicated columns headers
1 parent 448168b commit b7241e4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/js/core/factories/GridColumn.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ angular.module('ui.grid')
8989
* <pre>{ term: 'text', condition: uiGridConstants.filter.STARTS_WITH, placeholder: 'type to filter...', flags: { caseSensitive: false }, type: uiGridConstants.filter.SELECT, [ { value: 1, label: 'male' }, { value: 2, label: 'female' } ] }</pre>
9090
*
9191
*/
92+
93+
/**
94+
* @ngdoc property
95+
* @name extraStyle
96+
* @propertyOf ui.grid.class:GridColumn
97+
* @description additional on this column.
98+
* @example
99+
* <pre>{extraStyle: {display:'table-cell'}}</pre>
100+
*
101+
*/
92102

93103
/**
94104
* @ngdoc method
@@ -752,6 +762,7 @@ angular.module('ui.grid')
752762
// However, we do want to keep the settings if they change, just not the term
753763
if ( isNew ) {
754764
self.setPropertyOrDefault(colDef, 'filter');
765+
self.setPropertyOrDefault(colDef, 'extraStyle');
755766
self.setPropertyOrDefault(colDef, 'filters', defaultFilters);
756767
} else if ( self.filters.length === defaultFilters.length ) {
757768
self.filters.forEach( function( filter, index ){

src/templates/ui-grid/ui-grid-filter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui-grid-filter-container" ng-repeat="colFilter in col.filters" ng-class="{'ui-grid-filter-cancel-button-hidden' : colFilter.disableCancelFilterButton === true }">
1+
<div class="ui-grid-filter-container" ng-style="col.extraStyle" ng-repeat="colFilter in col.filters" ng-class="{'ui-grid-filter-cancel-button-hidden' : colFilter.disableCancelFilterButton === true }">
22
<div ng-if="colFilter.type !== 'select'">
33
<input type="text" class="ui-grid-filter-input" ng-model="colFilter.term" ng-attr-placeholder="{{colFilter.placeholder || ''}}" />
44

0 commit comments

Comments
 (0)