TablePanel: Enable new units picker (#22833)

This commit is contained in:
Dominik Prokop 2020-03-17 12:32:48 +01:00 committed by GitHub
parent 2fac834413
commit 58298919c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -58,7 +58,7 @@
<div ng-if="style.type === 'number'">
<div class="gf-form">
<label class="gf-form-label width-10">Unit</label>
<div class="gf-form-dropdown-typeahead width-16" ng-model="style.unit" dropdown-typeahead2="editor.unitFormats" dropdown-typeahead-on-select="editor.setUnitFormat(style, $subItem)"></div>
<unit-picker onChange="editor.setUnitFormat(style)" value="style.unit" width="16"></unit-picker>
</div>
<div class="gf-form">
<label class="gf-form-label width-10">Decimals</label>

View File

@ -73,9 +73,11 @@ export class ColumnOptionsCtrl {
this.panelCtrl.render();
}
setUnitFormat(column: any, subItem: any) {
column.unit = subItem.value;
this.panelCtrl.render();
setUnitFormat(column: any) {
return (value: any) => {
column.unit = value;
this.panelCtrl.render();
};
}
addColumnStyle() {