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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Muesli
Advocate I
Advocate I

how to add jQuery and bootstrap javascript?

Hello,

 

i want to create some buttons and a dropdown menu with bootstrap and jquery, but how can i add them to my visual?

cause when add the files to my pbiviz file and run the code, i am getting a bootstrap error that jQuery wasnt found

"Uncaught Error: Bootstrap's JavaScript requires jQuery"

my pbiviz looks like this:

  "externalJS": [
    "node_modules/jquery/dist/jquery.min.js",
    "src/source/bootstrap.min.js",

my tsconfig like this:

 "files": [
    ".api/v1.8.0/PowerBI-visuals.d.ts",
    "node_modules/@types/jquery/index.d.ts",
    "node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts",
    "src/settings.ts",
    "src/visual.ts",
    "src/javascript.js"

how can get it running?

1 ACCEPTED SOLUTION

thanks but this didnt work for me. i still got a error after doing that. 

I got it working with installing jquery with "typings install --save --global jquery" instead of "npm install @types/jquery@2.0.46  --save"

 

i just needed to referrenc the .d.ts file inside typings and i got it working. 

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Muesli,

 

You may check the solution below.

https://community.powerbi.com/t5/Developer/Custom-visual-jquery-and-other-js/td-p/155443

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thanks but this didnt work for me. i still got a error after doing that. 

I got it working with installing jquery with "typings install --save --global jquery" instead of "npm install @types/jquery@2.0.46  --save"

 

i just needed to referrenc the .d.ts file inside typings and i got it working. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.