Filters directive.

This commit is contained in:
Arik Fraimovich 2014-03-17 20:20:49 +02:00
parent 362c899632
commit 5ee924a770
3 changed files with 20 additions and 13 deletions

View File

@ -77,6 +77,13 @@
}
};
var Filters = function() {
return {
restrict: 'E',
templateUrl: '/views/visualizations/filters.html'
}
}
var EditVisualizationForm = function(Visualization, growl) {
return {
restrict: 'E',
@ -145,5 +152,6 @@
.provider('Visualization', VisualizationProvider)
.directive('visualizationRenderer', ['Visualization', VisualizationRenderer])
.directive('visualizationOptionsEditor', ['Visualization', VisualizationOptionsEditor])
.directive('filters', Filters)
.directive('editVisulatizationForm', ['Visualization', 'growl', EditVisualizationForm])
})();

View File

@ -1,17 +1,4 @@
<div>
<div class="btn-group pull-right" ng-repeat="filter in filters">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{filter.friendlyName}}: {{filter.current}}<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="value in filter.values">
<a href="#" ng-click="filter.current = value">{{value}}</a>
</li>
<li class="divider"></li>
<li><a href="#" ng-click="filter.current = 'All'">All</a></li>
</ul>
</div>
<smart-table rows="gridData" columns="gridColumns"
config="gridConfig"
class="table table-condensed table-hover"></smart-table>

View File

@ -0,0 +1,12 @@
<div class="well well-sm" ng-show="filters">
<div class="btn-group" ng-repeat="filter in filters">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{filter.friendlyName}}: {{filter.current}}<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="value in filter.values">
<a href="" ng-click="filter.current = value">{{value}}</a>
</li>
</ul>
</div>
</div>