Commit 58298919 by Dominik Prokop Committed by GitHub

TablePanel: Enable new units picker (#22833)

parent 2fac8344
......@@ -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>
......
......@@ -73,9 +73,11 @@ export class ColumnOptionsCtrl {
this.panelCtrl.render();
}
setUnitFormat(column: any, subItem: any) {
column.unit = subItem.value;
setUnitFormat(column: any) {
return (value: any) => {
column.unit = value;
this.panelCtrl.render();
};
}
addColumnStyle() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment