You need to sign in to do that
Don't have an account?
mahipal reddy
facing issue in acheiving popover in lightning components..
Hi Members,
I have a requiremnt in lighting , to display popover when user clicks on account name.
Basically i am displaying scollable list of accounts with names. and if user clicks on account name we should display account full details as popover.
I tried bootstrap popover() method but it is throwing errors...
HTML in the component:
Below is the error i am getting when clicked on account name:
I have a requiremnt in lighting , to display popover when user clicks on account name.
Basically i am displaying scollable list of accounts with names. and if user clicks on account name we should display account full details as popover.
I tried bootstrap popover() method but it is throwing errors...
HTML in the component:
<ul class="slds-list--vertical slds-has-dividers--top-space"> <li><a href="javascript:void(0);" id="abcd" title="Header" onclick="{!c.displaypopup}" data-toggle="popover" data-placement="top" data-content="right">Test Account 1</a></li> <li><a href="javascript:void(0);" title="Header" data-toggle="popover" onclick="{!c.displaypopup}" data-placement="right" data-content="Content">Test Account 2</a></li> <li><a href="javascript:void(0);" title="Header" data-toggle="popover" onclick="{!c.displaypopup}" data-placement="right" data-content="Content">Test Account 3</a></li> <li><a href="javascript:void(0);" title="Header" data-toggle="popover" onclick="{!c.displaypopup}" data-placement="right" data-content="Content">Test Account 4</a></li> </ul>Controller Method:
displaypopup : function(component, event, helper){ var popup=event.currentTarget; var listid =popup.id; var jqelement = $("#"+listid); console.log('element clicked',listid); console.log('jqelement ',jqelement); jqelement.popover(); },
Below is the error i am getting when clicked on account name:
please check your bootstrap laibrary (css and js) is working well. than try bleow code .its working good :)
js controller
result -:
if you dont add jquery file on your component go to the link and --> right click -- save as-- save file as file.js and upload at static resources in zip file and using it your component and also check your current bootstrape libarary
https://code.jquery.com/jquery-2.2.4.min.js (https://code.jquery.com/jquery-2.2.4.min.js" target="_blank)
Thanks :)
If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer. :-)
Hi Piyush,
Some new Error Came...
got this error now.
I have downloaded bootstrap from "http://getbootstrap.com/getting-started/#download".
and Jquery from "https://code.jquery.com/jquery-2.2.4.min.js".
APP :
and Controller code same as yours...
you got this error because any of your bootstrap or jquery file not load successfully
please double check your static resources file Name and path in zip file.
upload 2 zip files
1 for bootstrap and
1 for only jquery file
focus on css, and js file path location. open zip file in your system and check the file proper path and name.
Thanks
let me inform if it work and mark it solve :)
Check out this link:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_code.htm