<?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 Extending the sample JQuery Widget to use JQueryUI in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870360#M12759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the "UseJQuery" sample widget working (it's located in the arcgis-web-appbuilder-1.0\client\stemapp\widgets\samplewidgets directory). That's great, but now what I want to do is make use of JQuery modal dialogs. I have a generic HTML page where this works, but I'm not sure how to make dialogs work in the widget. In the HTML page, I have references the library using a script tag like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://code.jquery.com/ui/1.10.3/jquery-ui.js" title="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&amp;lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the&amp;nbsp; JQuery Ready function I'm doing this to : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var btn = $('#btnShowModalDialog');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; btn.click(function() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#popupdiv").dialog({&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open: function(event, ui){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something in the open function which will ultimately show the contents of popupdiv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title: "Cost Items for DX Feature",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 430,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 500,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modal: true,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttons: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close: function() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).dialog('close');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is how and where do I reference external JQuery libraries in the widget, and how would I write corresponding code in Widget.js? I'm assuming that I can put the hidden popupdiv and the btnShowModalDialog button in Widget.html, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2015 16:19:34 GMT</pubDate>
    <dc:creator>RiverTaig1</dc:creator>
    <dc:date>2015-02-05T16:19:34Z</dc:date>
    <item>
      <title>Extending the sample JQuery Widget to use JQueryUI</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870360#M12759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the "UseJQuery" sample widget working (it's located in the arcgis-web-appbuilder-1.0\client\stemapp\widgets\samplewidgets directory). That's great, but now what I want to do is make use of JQuery modal dialogs. I have a generic HTML page where this works, but I'm not sure how to make dialogs work in the widget. In the HTML page, I have references the library using a script tag like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://code.jquery.com/ui/1.10.3/jquery-ui.js" title="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&amp;lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the&amp;nbsp; JQuery Ready function I'm doing this to : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var btn = $('#btnShowModalDialog');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; btn.click(function() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#popupdiv").dialog({&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open: function(event, ui){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something in the open function which will ultimately show the contents of popupdiv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title: "Cost Items for DX Feature",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 430,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 500,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modal: true,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttons: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close: function() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).dialog('close');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is how and where do I reference external JQuery libraries in the widget, and how would I write corresponding code in Widget.js? I'm assuming that I can put the hidden popupdiv and the btnShowModalDialog button in Widget.html, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 16:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870360#M12759</guid>
      <dc:creator>RiverTaig1</dc:creator>
      <dc:date>2015-02-05T16:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the sample JQuery Widget to use JQueryUI</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870361#M12760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi River, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this doesn't totally answer your question, but what I have done is added JQuerythrough the init.js page under resources "resources = resources.concat([" - you can then point to a local file or to the external link for JQuery.&amp;nbsp; The reason that I do it this way instead of in the widget is because I end up using JQueryin a few of my widgets in the same application and therefor don't want to add it in individually each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as where to insert the code inside of widget.js, inside the "startup: function (){" works fine for me.&amp;nbsp; Yes, you are able to insert the popupdiv and the btnShowModalDialog button inside of Widget.html.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Nat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 10:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870361#M12760</guid>
      <dc:creator>NEvatt</dc:creator>
      <dc:date>2015-02-10T10:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the sample JQuery Widget to use JQueryUI</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870362#M12761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;What I'm finding is that the order that references are listed in init.js resources &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; line-height: 1.5;"&gt;does NOT guarantee the order in which things load.&amp;nbsp; For example, I have the following:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resources = resources.concat([&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://code.jquery.com/jquery-latest.min.js" rel="nofollow" target="_blank"&gt;http://code.jquery.com/jquery-latest.min.js&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://code.jquery.com/ui/1.10.3/jquery-ui.js" rel="nofollow" target="_blank"&gt;http://code.jquery.com/ui/1.10.3/jquery-ui.js&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" rel="nofollow" target="_blank"&gt;http://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="nofollow" target="_blank"&gt;http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; window.path + 'css/jquery.dataTables.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; window.path + 'css/ESRIOverride.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.apiUrl + 'dojo/resources/dojo.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.apiUrl + 'dijit/themes/claro/claro.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.apiUrl + 'esri/css/esri.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.apiUrl + 'dojox/layout/resources/ResizeHandle.css',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.path + 'jimu.js/css/jimu.css'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes, jquery-latest.min.js loads first (which is what I want) and things work.&amp;nbsp; At other times, jquery-ui will load first and because it has dependencies on jQuery, it causes problems.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you mandate that one .js file loads before another?&amp;nbsp;&amp;nbsp; Must I modify script tags in index.html?&amp;nbsp; That doesn't seem like a very good practice.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 18:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/extending-the-sample-jquery-widget-to-use-jqueryui/m-p/870362#M12761</guid>
      <dc:creator>RiverTaig1</dc:creator>
      <dc:date>2015-02-24T18:00:48Z</dc:date>
    </item>
  </channel>
</rss>

