Skip to content

Commit d9b5182

Browse files
authored
Merge pull request #3928 from MaksimSimkin/master
apply extraStyle property to give possibility to change style of dedi…
2 parents d364555 + f8af72a commit d9b5182

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/js/core/factories/GridColumn.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@ angular.module('ui.grid')
8181
* <pre>{ term: 'text', condition: uiGridConstants.filter.STARTS_WITH, placeholder: 'type to filter...', ariaLabel: 'Filter for text', flags: { caseSensitive: false }, type: uiGridConstants.filter.SELECT, [ { value: 1, label: 'male' }, { value: 2, label: 'female' } ] }</pre>
8282
*
8383
*/
84-
84+
85+
/**
86+
* @ngdoc property
87+
* @name extraStyle
88+
* @propertyOf ui.grid.class:GridColumn
89+
* @description additional on this column.
90+
* @example
91+
* <pre>{extraStyle: {display:'table-cell'}}</pre>
92+
*
93+
*/
94+
8595
/**
8696
* @ngdoc object
8797
* @name ui.grid.class:GridColumn
@@ -795,6 +805,7 @@ angular.module('ui.grid')
795805
// However, we do want to keep the settings if they change, just not the term
796806
if ( isNew ) {
797807
self.setPropertyOrDefault(colDef, 'filter');
808+
self.setPropertyOrDefault(colDef, 'extraStyle');
798809
self.setPropertyOrDefault(colDef, 'filters', defaultFilters);
799810
} else if ( self.filters.length === defaultFilters.length ) {
800811
self.filters.forEach( function( filter, index ){

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div
22
class="ui-grid-filter-container"
3+
ng-style="col.extraStyle"
34
ng-repeat="colFilter in col.filters"
45
ng-class="{'ui-grid-filter-cancel-button-hidden' : colFilter.disableCancelFilterButton === true }">
56
<div
@@ -31,6 +32,7 @@
3132
<select
3233
class="ui-grid-filter-select ui-grid-filter-input-{{$index}}"
3334
ng-model="colFilter.term"
35+
ng-show="colFilter.selectOptions.length > 0"
3436
ng-attr-placeholder="{{colFilter.placeholder || aria.defaultFilterLabel}}"
3537
aria-label="{{colFilter.ariaLabel || ''}}"
3638
ng-options="option.value as option.label for option in colFilter.selectOptions">

0 commit comments

Comments
 (0)