Rýchly filter formátovania TextInput
TextInput je jednoduchý rýchly filter formátovania, ktorý predstavuje text typ objektu zo súboru capabilities.json
.
Príklad: Implementácia funkcie Vstup textu
V tomto príklade si ukážeme, ako vytvoriť TextInput výsek pomocou pomôcok formátovania modelu.
Objekt možností
Do capabilities.json
súboru vložte nasledujúci fragment JSON.
{
// ... same level as dataRoles and dataViewMappings
"objects": {
"labels": {
"properties": {
"title": {
"type": {
"text": true
}
}
}
}
}
}
Trieda modelu formátovania
Do súboru nastavení vložte nasledujúci fragment kódu.
import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
class LabelsCardSetting extends formattingSettings.SimpleCard {
name: string = "labels"; // same as capabilities object name
displayName: string = "Labels";
public title: formattingSettings.TextInput = new formattingSettings.TextInput({
name: "title", // same as capabilities property name
displayName: "Title",
value: "",
placeholder: "Title placeholder"
});
public slices: formattingSettings.Slice[] = [ this.title ];
}
export class VisualSettings extends formattingSettings.Model {
public labels: LabelsCardSetting = new LabelsCardSetting();
public cards: formattingSettings.SimpleCard[] = [this.labels];
}
Súvisiaci obsah
- tably Formát
- pomôcky pre model formátovania