<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Customized popup in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88429#M4827</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to display a popup like the "about splunk " or the "custom time" one when a user click on a field inside my application.&lt;/P&gt;

&lt;P&gt;I know how to display a random popup, but I don't want to reimplement everything (lock the background, center the popup, return selected values to the main page etc), so I just want to add a new popup based on, let's say the custom time selection popup.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/26419/how-can-i-modify-the-about-splunk-popup"&gt;this topic&lt;/A&gt; is close but not really helpfull. Someone &lt;A href="http://splunk-base.splunk.com/answers/63579/how-to-add-html-in-popup-window"&gt;here&lt;/A&gt; has basically the same need as me.&lt;/P&gt;

&lt;P&gt;Does anyone knows how to do it, or where to find information about it?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT: The location of the TimeRangePickerModule is:&lt;/P&gt;

&lt;P&gt;share/splunk/search_mrsparkle/modules/search/TimeRangePicker.js&lt;/P&gt;

&lt;P&gt;I have found usefull info there, namely the:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;new Splunk.Popup();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which creates exactly what I want (a default splunk popup). So my question is: is there a documentation somewhere on the framework? Or do I need to crawl in the *.js, *.conf, *.py to find what I want? (for example how to set up the name of the popup). &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT 2&lt;/P&gt;

&lt;P&gt;Based on what I have found in the share/splunk/search_mrsparkle/exposed/js/Popup.js code, I have put together a very naive basic popup that just appears with a submit and cancel button. I am still working on adding custom content inside. But I cannot find any docs on it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var _myPopup;

function createMyPopup()
{
        _myPopup = new Splunk.Popup($('.popupScaffolding'), {
           title : "My Popup",
           pclass : "myPopupClass",
           buttons : [
                {
                   label: 'Cancel',
                   type : 'secondary',
                   callback: cancel
                },
                {
                   label: 'Apply',
                   type : 'primary',
                   callback: handleSaveSubmit
               }
           ]
       });
}


function cancel()
{
        _myPopup.destroyPopup();
        return false;
}

function handleSaveSubmit()
{
        _myPopup.destroyPopup();
        return true;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Guilhem&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2013 13:32:03 GMT</pubDate>
    <dc:creator>guilhem</dc:creator>
    <dc:date>2013-04-09T13:32:03Z</dc:date>
    <item>
      <title>Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88429#M4827</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to display a popup like the "about splunk " or the "custom time" one when a user click on a field inside my application.&lt;/P&gt;

&lt;P&gt;I know how to display a random popup, but I don't want to reimplement everything (lock the background, center the popup, return selected values to the main page etc), so I just want to add a new popup based on, let's say the custom time selection popup.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/26419/how-can-i-modify-the-about-splunk-popup"&gt;this topic&lt;/A&gt; is close but not really helpfull. Someone &lt;A href="http://splunk-base.splunk.com/answers/63579/how-to-add-html-in-popup-window"&gt;here&lt;/A&gt; has basically the same need as me.&lt;/P&gt;

&lt;P&gt;Does anyone knows how to do it, or where to find information about it?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT: The location of the TimeRangePickerModule is:&lt;/P&gt;

&lt;P&gt;share/splunk/search_mrsparkle/modules/search/TimeRangePicker.js&lt;/P&gt;

&lt;P&gt;I have found usefull info there, namely the:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;new Splunk.Popup();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which creates exactly what I want (a default splunk popup). So my question is: is there a documentation somewhere on the framework? Or do I need to crawl in the *.js, *.conf, *.py to find what I want? (for example how to set up the name of the popup). &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT 2&lt;/P&gt;

&lt;P&gt;Based on what I have found in the share/splunk/search_mrsparkle/exposed/js/Popup.js code, I have put together a very naive basic popup that just appears with a submit and cancel button. I am still working on adding custom content inside. But I cannot find any docs on it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var _myPopup;

function createMyPopup()
{
        _myPopup = new Splunk.Popup($('.popupScaffolding'), {
           title : "My Popup",
           pclass : "myPopupClass",
           buttons : [
                {
                   label: 'Cancel',
                   type : 'secondary',
                   callback: cancel
                },
                {
                   label: 'Apply',
                   type : 'primary',
                   callback: handleSaveSubmit
               }
           ]
       });
}


function cancel()
{
        _myPopup.destroyPopup();
        return false;
}

function handleSaveSubmit()
{
        _myPopup.destroyPopup();
        return true;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Guilhem&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 13:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88429#M4827</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-09T13:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88430#M4828</link>
      <description>&lt;P&gt;I am slowly crawling the Popup.js file, and I have "improved" my popup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   _myPopup = Splunk.Popup.createEAIForm(window, "My popup", 
    {
            url : Splunk.util.make_url('manager',                                                
            Splunk.util.getCurrentApp(),                                                
            '/saved/eventtypes/_new?action=edit&amp;amp;noContainer=2&amp;amp;viewFilter=modal&amp;amp;eleOnly=1'), 
             title : "My Popup",
            pclass : "myPopupClass",
            buttons :
            [
                    {
                            label: 'Cancel',
                            type : 'secondary',
                            callback: cancel
                    },
                    {
                            label: 'Apply',
                            type : 'primary',
                            callback: handleSaveSubmit
                    }
            ]
    });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think I have understood that you can't directly inject some html code inside it. It looks like you have to take the layout of the popup from a page (by the url property). I have taken this example from the Popup.js file itself, and I can use it in my page, but there is so many things that I still don't have any clue:&lt;/P&gt;

&lt;P&gt;1°) How to create the html content and where to put it for it to be displayed in the popup&lt;BR /&gt;
2°) How do you pass values back and forth the page &amp;lt;-&amp;gt; popup (how do you save changes done in the popup)&lt;BR /&gt;
3°) Where can I find documentation on the Popup class (except from inside the code comments)? (I don't know what meansEAIForm, what exactly does the make_url function ...)&lt;/P&gt;

&lt;P&gt;If any one could help, it would be greatly appreciated&lt;/P&gt;

&lt;P&gt;PS: I have put it inside another answer for clarity, besides it partially answer the question&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT:&lt;/P&gt;

&lt;P&gt;I was able to answer 1°) : here is the code of my popup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_myPopup = Splunk.Popup.createEAIForm(window, "My Popup Name",
{
        url : Splunk.util.make_url('app', Splunk.util.getCurrentApp(), 'The view you want your popup to be populated with'),

        title : "My popup",
        pclass : "myPopupClass",
        buttons :
        [
                {
                        label: 'Cancel',
                        type : 'secondary',
                        callback: cancel
                },
                {
                        label: 'Apply',
                        type : 'primary',
                        callback: handleSaveSubmit
                }
        ]
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I still have a problem (JS error: TypeError: Splunk.EAI.getInstance(...) is null). I am currently investigating.&lt;/P&gt;

&lt;P&gt;Hope this helps, but I still don't know how to do n°2.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 16:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88430#M4828</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-09T16:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88431#M4829</link>
      <description>&lt;P&gt;All right I am stucked. The method above is not the right way to go. I must use the new Splunk.Popup, but even if the html code I put inside show in the firebug console, it DOESN'T APPEAR in the popup. That very confusing. I don't know what to do. If anybody has an idea.&lt;/P&gt;

&lt;P&gt;btw I'm using splunk 4.3&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2013 13:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88431#M4829</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-11T13:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88432#M4830</link>
      <description>&lt;P&gt;OK, finally I have managed to make this thing work, here is the popup code (there was a problem in the div I used, the css was making the content disappearing) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   _mypopup = new  Splunk.Popup('&amp;lt;p&amp;gt; TEST TEST  &amp;lt;/p&amp;gt;',
    {
            title : "My title",
            pclass : "myPopupClass",
            cloneFlag : false,
            buttons : 
            [
                    {
                            label: 'Cancel',
                            type : 'secondary',
                            callback: cancel
                    },
                    {
                            label: 'Apply',
                            type : 'primary',
                            callback: handleSaveSubmit
                    }
            ]
    });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;I still don't know how to save the things I will choose from the popup to the main page. If anybody knows how to do, It will save me some time.&lt;/P&gt;

&lt;P&gt;Guilhem&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:19:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88432#M4830</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-11T14:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88433#M4831</link>
      <description>&lt;P&gt;As this works, I will accept it, but still, I am not satisfied with it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 12:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88433#M4831</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-15T12:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88434#M4832</link>
      <description>&lt;P&gt;Have you been able to make it all work into a module? I'm working on something similar and was wondering if you could share the solution. I have been looking at the Active Directory App which uses pop as well. In there is a module called MSADAppChecker which does a pop up based on a set of data.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 16:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88434#M4832</guid>
      <dc:creator>hvandenb</dc:creator>
      <dc:date>2013-07-31T16:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88435#M4833</link>
      <description>&lt;P&gt;Can you help me understand regarding the popup. Should we keep the JS for popup separately in a js file and use that in the dashoboard`s xml? sorry I am a newbie and trying to understand. My requirement is just to open a popup after clicking a button and give some info over there, later after clicking close button on the popup , the window should be closed. Please help me!!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88435#M4833</guid>
      <dc:creator>Tejkumar451</dc:creator>
      <dc:date>2016-10-31T22:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88436#M4834</link>
      <description>&lt;P&gt;This is an old question, but leaving this here in case someone else is looking for the solution (like me): &lt;A href="https://www.splunk.com/blog/2014/02/24/using-bootstrap-modal-with-splunk-simple-xml.html"&gt;https://www.splunk.com/blog/2014/02/24/using-bootstrap-modal-with-splunk-simple-xml.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 02:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88436#M4834</guid>
      <dc:creator>cblanton</dc:creator>
      <dc:date>2019-07-24T02:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Customized popup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88437#M4835</link>
      <description>&lt;P&gt;This is an old question, but here's a solution if someone else is also looking for it: &lt;A href="https://www.splunk.com/blog/2014/02/24/using-bootstrap-modal-with-splunk-simple-xml.html"&gt;https://www.splunk.com/blog/2014/02/24/using-bootstrap-modal-with-splunk-simple-xml.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 02:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customized-popup/m-p/88437#M4835</guid>
      <dc:creator>cblanton</dc:creator>
      <dc:date>2019-07-24T02:55:16Z</dc:date>
    </item>
  </channel>
</rss>

