mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 18:52:33 +08:00
TablePanel: Enable new units picker (#22833)
This commit is contained in:
@ -58,7 +58,7 @@
|
|||||||
<div ng-if="style.type === 'number'">
|
<div ng-if="style.type === 'number'">
|
||||||
<div class="gf-form">
|
<div class="gf-form">
|
||||||
<label class="gf-form-label width-10">Unit</label>
|
<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>
|
||||||
<div class="gf-form">
|
<div class="gf-form">
|
||||||
<label class="gf-form-label width-10">Decimals</label>
|
<label class="gf-form-label width-10">Decimals</label>
|
||||||
|
@ -73,9 +73,11 @@ export class ColumnOptionsCtrl {
|
|||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
setUnitFormat(column: any, subItem: any) {
|
setUnitFormat(column: any) {
|
||||||
column.unit = subItem.value;
|
return (value: any) => {
|
||||||
this.panelCtrl.render();
|
column.unit = value;
|
||||||
|
this.panelCtrl.render();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
addColumnStyle() {
|
addColumnStyle() {
|
||||||
|
Reference in New Issue
Block a user