Skip to content

Commit 42774c5

Browse files
author
Simkin, Maksim
committed
apply extraStyle property to give possibility to change style of dedicated columns headers
1 parent 18a487e commit 42774c5

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
@@ -79,6 +79,16 @@ angular.module('ui.grid')
7979
* <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>
8080
*
8181
*/
82+
83+
/**
84+
* @ngdoc property
85+
* @name extraStyle
86+
* @propertyOf ui.grid.class:GridColumn
87+
* @description additional on this column.
88+
* @example
89+
* <pre>{extraStyle: {display:'table-cell'}}</pre>
90+
*
91+
*/
8292

8393
/**
8494
* @ngdoc object
@@ -742,6 +752,7 @@ angular.module('ui.grid')
742752
// However, we do want to keep the settings if they change, just not the term
743753
if ( isNew ) {
744754
self.setPropertyOrDefault(colDef, 'filter');
755+
self.setPropertyOrDefault(colDef, 'extraStyle');
745756
self.setPropertyOrDefault(colDef, 'filters', defaultFilters);
746757
} else if ( self.filters.length === defaultFilters.length ) {
747758
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)