Dashboards & Visualizations

how to add html in popup window

john
Communicator

Hi,

I want to show a popup window having checkboxes when i click a button.

Here is the code i have tried,found from popup.js file.But iam not able to add any html content to that.Please help

var popup = new Splunk.Popup($('.popupScaffolding'), {
title : "My Popup",
contents:"

some text
Uncheck this box to disable.
",
pclass : "myPopupClass",
buttons : [
{
label: 'Cancel',
type : 'secondary',
callback: function(){
return this.popupCancel();
}.bind(this)
},
{
label: 'Apply',
type : 'primary',
callback: function(){
return this.popupAccept();
}.bind(this)
}
]
});

Tags (1)

cblanton
Communicator

This is an old post, but leaving this here in case someone else is looking for it (like me): https://www.splunk.com/blog/2014/02/24/using-bootstrap-modal-with-splunk-simple-xml.html

0 Karma

guilhem
Contributor

Hi, I am trying to do the same here, I suggest you take a look.

By the way, here is the code documentation from the Popup.js file:

cloneFlag: (bool) Flag to tell popup whether to clone the passed contents into the popup (true) or move them. This should generally only be left as true when passing a reference to an existing element that you wish to
leave untouched, for example a dom scaffolding you intend to reuse.

contents: (JQuery object or html) The contents of the popup. (ex: $('.popupContainer')). NOTE: if html is used, cloneFlag should be set to false

RohiniJindam
Path Finder

Perhaps its:

$SPLUNKHOME\share\splunk\search_mrsparkle\exposed\js\popup.js

0 Karma

RohiniJindam
Path Finder

Where can i find the code documentation from the Popup.js file?

0 Karma

john
Communicator

Anyone there....Please suggest the way to do this

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...