Skip to content

Commit

Permalink
#91: champs éditables et checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbonifas committed Jul 21, 2015
1 parent 4e44452 commit 0328bb8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ angular
'ui.select',
'ui.bootstrap-slider',
'ui.keypress',
'ui.grid'
'ui.grid',
'ui.grid.edit'
])
.config(function($routeProvider) {
$routeProvider
Expand Down
17 changes: 13 additions & 4 deletions app/scripts/controllers/commonmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,28 @@ angular.module('accessimapEditeurDerApp')
'f0': 'Aucune interaction',
'f1': 'Valeur OSM'
}, {
'id': 'expandable',
'id': 'Guidage',
'f0': false,
'f1': false
'f1': true,
'type': 'boolean'
}, {
'id': 'title',
'f0': 'Titre par défaut',
}];

var checkboxTemplate = '<input ng-if="row.entity.type === \'boolean\'" type="checkbox" value="{{row.entity[col.field]}}" ng-model="row.entity[col.field]"><div ng-if="row.entity.type !== \'boolean\'">{{row.entity[col.field]}}</div>';

$scope.interactiveFilters = {
data: $scope.interactiveFiltersInit
data: $scope.interactiveFiltersInit,
showSelectionCheckbox: true,
enableSorting: false,
columnDefs: [
{ name: 'id', enableCellEdit: false },
{ name: 'f0', cellTemplate: checkboxTemplate },
{ name: 'f1', cellTemplate: checkboxTemplate }
],
};


d3.select('svg').append('defs')
.append('marker')
.attr('id', 'midmarker')
Expand Down
2 changes: 1 addition & 1 deletion app/views/commonmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@
<i class="fa fa-times"></i>
</span>
Ajouter des interactions
<div ui-grid="interactiveFilters" class="myGrid"></div>
<div ui-grid="interactiveFilters" ui-grid-edit class="myGrid"></div>
</div>

0 comments on commit 0328bb8

Please sign in to comment.