Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
az2451
Resolver I
Resolver I

Create custom slider for a custom visual plot

Hi guys,

 

i want to build a slider similar like in this picture here

 

Before i design the slider, i just want to read values dynamically from a simple textbox. I managed that without problems by creating a DOM-Element (input) with js

 

But as i try changing the value, it just stays static (it still returns the value 800) 😞

 

Does anyone have i idea how to read the values from an textbox when i change the value on it?

 

 

		private createHelpLinkElement3(): Element {
            let linkElement = document.createElement("input");
			linkElement.setAttribute("value", "800");
            linkElement.setAttribute("class", "helpLink3");
            return linkElement;
        };

 

 

Here you can download my project

 

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

Hi @az2451

 

We'd recommend to bind a keypress event to catch each change:

this.helpLinkElement3.addEventListener("keypress", (event) => {
    this.getx = parseInt((event.target as HTMLInputElement).value);

    console.log(this.getx);
});

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

2 REPLIES 2
v-viig
Community Champion
Community Champion

Hi @az2451

 

We'd recommend to bind a keypress event to catch each change:

this.helpLinkElement3.addEventListener("keypress", (event) => {
    this.getx = parseInt((event.target as HTMLInputElement).value);

    console.log(this.getx);
});

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

You are so amazing 🙂 

 

Thank you!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.