<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Disable The Stylesheets &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/disable-the-stylesheets/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 28 Oct 2015 13:40:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Disable The Stylesheets &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Change Themes Dynamically In Grid</title>
		<link>https://sibeeshpassion.com/change-themes-dynamically-in-grid/</link>
					<comments>https://sibeeshpassion.com/change-themes-dynamically-in-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 28 Oct 2015 13:40:51 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Apply Themes In Grid]]></category>
		<category><![CDATA[Change Themes Dynamically]]></category>
		<category><![CDATA[Disable The Stylesheets]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10855</guid>

					<description><![CDATA[In this post we will see how we can Change Themes Dynamically In Grid . I recently came across a situation to change the grid&#8217;s theme dynamically, when ever user select any theme. So I have done this requirement by using some in-built functionalities of jQWidget JQX grid. Here I am going to share you that. I hope you will like it. To load a grid from a JSON, you can follows the steps as discussed in this article: Load jQWidget JQX Grid From JSON Background If you are new to JQWidget JQX Grid, Please find out here: http://sibeeshpassion.com/category/jqwidgets/ Download [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can Change Themes Dynamically In Grid . I recently came across a situation to change the grid&#8217;s theme dynamically, when ever user select any theme. So I have done this requirement by using some in-built functionalities of jQWidget JQX grid. Here I am going to share you that. I hope you will like it.</p>
<p>To load a grid from a JSON, you can follows the steps as discussed in this article: <a href="http://sibeeshpassion.com/bind-json-data-to-jqwidget-jqx-grid/">Load jQWidget JQX Grid From JSON</a></p>
<p><strong>Background</strong></p>
<p>If you are new to JQWidget JQX Grid, Please find out here: <a href="http://sibeeshpassion.com/category/jqwidgets/" target="_blank">http://sibeeshpassion.com/category/jqwidgets/</a></p>
<p><strong>Download the Source Code</strong></p>
<p>Please download the source code from here: <a href="http://sibeeshpassion.com/download/changetheme.rar" target="_blank">Change Themes Dynamically</a></p>
<p><strong>Using the code</strong></p>
<p>I hope you have implemented your grid as shown in that article. Now I guess your page will be looking like this.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            // prepare the data<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;AreaCode&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Revenue&quot;, &quot;type&quot;: &quot;number&quot; }],<br />
                url: &quot;jsonData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;Area Code&quot;, &quot;dataField&quot;: &quot;AreaCode&quot;, &quot;cellsalign&quot;: &quot;left&quot;, &quot;cellsformat&quot;: &quot;d&quot; }, { &quot;text&quot;: &quot;Revenue&quot;, &quot;dataField&quot;: &quot;Revenue&quot;, &quot;cellsalign&quot;: &quot;right&quot;, &quot;cellsformat&quot;: &quot;c2&quot; }],<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;float: left; width: 99.9%;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p>Now let us make sure that grid is working fine. Please run your project. </p>
<div id="attachment_10856" style="width: 620px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-10856" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png" alt="Change Themes Dynamically In Grid " width="610" height="470" class="size-full wp-image-10856" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png 610w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid-300x231.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid-400x308.png 400w" sizes="(max-width: 610px) 100vw, 610px" /></a><p id="caption-attachment-10856" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<p>Cool, so grid is loaded. Now need to add a select control in which we are going to load theme names so that user can select the theme and apply. Is that fine?</p>
<p>[html]<br />
  &lt;select id=&quot;selectOptions&quot; onchange=&quot;applyNewCSS()&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Template&lt;/option&gt;<br />
        &lt;option value=&quot;metro&quot;&gt;metro&lt;/option&gt;<br />
        &lt;option value=&quot;office&quot;&gt;office&lt;/option&gt;<br />
        &lt;option value=&quot;orange&quot;&gt;orange&lt;/option&gt;<br />
        &lt;option value=&quot;energyblue&quot;&gt;energyblue&lt;/option&gt;<br />
        &lt;option value=&quot;darkblue&quot;&gt;darkblue&lt;/option&gt;<br />
        &lt;option value=&quot;shinyblack&quot;&gt;shinyblack&lt;/option&gt;<br />
        &lt;option value=&quot;lightness&quot; selected=&quot;selected&quot;&gt;lightness&lt;/option&gt;<br />
        &lt;option value=&quot;android&quot;&gt;android&lt;/option&gt;<br />
    &lt;/select&gt;<br />
[/html]</p>
<p>The next thing is we need to add the CSS links to the page, here I am going to add some of the CSS references as follows.</p>
<p>[html]<br />
&lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.darkblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;darkblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.energyblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;energyblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metro.css&quot; rel=&quot;stylesheet&quot; title=&quot;metro&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metrodark.css&quot; rel=&quot;stylesheet&quot; title=&quot;metrodark&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.office.css&quot; rel=&quot;stylesheet&quot; title=&quot;office&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-darkness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-darkness&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-le-frog.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-le-frog&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-lightness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-lightness.&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-sunny.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-sunny&quot; /&gt;<br />
[/html]</p>
<p>Have you noticed that we are calling the function applyNewCSS in the on change event of the select control. So next thins we will add that function.</p>
<p>[js]<br />
 function applyNewCSS() {<br />
            var css = $.trim($(&quot;#selectOptions&quot;).val());<br />
            if (css == &#8216;metro&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metro&#8217; });<br />
            }<br />
            else if (css == &#8216;metrodark&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metrodark&#8217; });<br />
            }<br />
            else if (css == &#8216;office&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;office&#8217; });<br />
            } else if (css == &#8216;orange&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;orange&#8217; });<br />
            } else if (css == &#8216;energyblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;energyblue&#8217; });<br />
            } else if (css == &#8216;darkblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;darkblue&#8217; });<br />
            } else if (css == &#8216;black&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;black&#8217; });<br />
            } else if (css == &#8216;shinyblack&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;shinyblack&#8217; });<br />
            } else if (css == &#8216;lightness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;lightness&#8217; });<br />
            } else if (css == &#8216;ui-le-frog&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-le-frog&#8217; });<br />
            } else if (css == &#8216;ui-darkness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-darkness&#8217; });<br />
            } else if (css == &#8216;ui-sunny&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-sunny&#8217; });<br />
            }<br />
            else if (css == &#8216;android&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;android&#8217; });<br />
            }<br />
        }<br />
[/js]</p>
<blockquote><p>So we can add the theme to the grid as  $(&#8220;#jqxgrid&#8221;).jqxGrid({ theme: &#8216;theme name&#8217; });</p></blockquote>
<p>Here we are applying the theme to the grid according to the user selection. Oops, we forgot one thing. If you apply CSS style sheet directly, the styles won&#8217;t get applied in the page contents. For that we need to disable the remaining style sheets and enable the selected one alone.</p>
<p>Following code will do that magic.</p>
<p>[js]<br />
var i, link_tag;<br />
            for (i = 0, link_tag = document.getElementsByTagName(&quot;link&quot;) ; i &lt; link_tag.length; i++) {<br />
                if ((link_tag[i].rel.indexOf(&quot;stylesheet&quot;) != -1) &amp;&amp; link_tag[i].title) {<br />
                    link_tag[i].disabled = true;<br />
                    if (link_tag[i].title == css) {<br />
                        link_tag[i].disabled = false;<br />
                    }<br />
                }<br />
                set_cookie(&#8216;style&#8217;, css, 30);<br />
            }<br />
[/js]</p>
<p>We are finding all of the link reference and find out whose rel property has the word &#8216;stylesheet&#8217;. Now it is time to see how it woks. </p>
<div id="attachment_10857" style="width: 648px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png"><img decoding="async" aria-describedby="caption-attachment-10857" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png" alt="Change Themes Dynamically In Grid " width="638" height="540" class="size-full wp-image-10857" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png 638w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1-300x254.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1-400x339.png 400w" sizes="(max-width: 638px) 100vw, 638px" /></a><p id="caption-attachment-10857" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<div id="attachment_10858" style="width: 637px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png"><img decoding="async" aria-describedby="caption-attachment-10858" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png" alt="Change Themes Dynamically In Grid" width="627" height="505" class="size-full wp-image-10858" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png 627w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2-300x242.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2-400x322.png 400w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-10858" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<p>You can see that the grid themes are changing according to the user selection of theme.That&#8217;s all we have done it. </p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.darkblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;darkblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.energyblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;energyblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metro.css&quot; rel=&quot;stylesheet&quot; title=&quot;metro&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metrodark.css&quot; rel=&quot;stylesheet&quot; title=&quot;metrodark&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.office.css&quot; rel=&quot;stylesheet&quot; title=&quot;office&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-darkness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-darkness&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-le-frog.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-le-frog&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-lightness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-lightness.&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-sunny.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-sunny&quot; /&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        function applyNewCSS() {<br />
            var css = $.trim($(&quot;#selectOptions&quot;).val());<br />
            var i, link_tag;<br />
            for (i = 0, link_tag = document.getElementsByTagName(&quot;link&quot;) ; i &lt; link_tag.length; i++) {<br />
                if ((link_tag[i].rel.indexOf(&quot;stylesheet&quot;) != -1) &amp;&amp; link_tag[i].title) {<br />
                    link_tag[i].disabled = true;<br />
                    if (link_tag[i].title == css) {<br />
                        link_tag[i].disabled = false;<br />
                    }<br />
                }<br />
            }<br />
            if (css == &#8216;metro&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metro&#8217; });<br />
            }<br />
            else if (css == &#8216;metrodark&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metrodark&#8217; });<br />
            }<br />
            else if (css == &#8216;office&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;office&#8217; });<br />
            } else if (css == &#8216;orange&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;orange&#8217; });<br />
            } else if (css == &#8216;energyblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;energyblue&#8217; });<br />
            } else if (css == &#8216;darkblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;darkblue&#8217; });<br />
            } else if (css == &#8216;black&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;black&#8217; });<br />
            } else if (css == &#8216;shinyblack&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;shinyblack&#8217; });<br />
            } else if (css == &#8216;lightness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;lightness&#8217; });<br />
            } else if (css == &#8216;ui-le-frog&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-le-frog&#8217; });<br />
            } else if (css == &#8216;ui-darkness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-darkness&#8217; });<br />
            } else if (css == &#8216;ui-sunny&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-sunny&#8217; });<br />
            }<br />
            else if (css == &#8216;android&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;android&#8217; });<br />
            }<br />
        }<br />
        $(document).ready(function () {<br />
            // prepare the data<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;AreaCode&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Revenue&quot;, &quot;type&quot;: &quot;number&quot; }],<br />
                url: &quot;jsonData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;Area Code&quot;, &quot;dataField&quot;: &quot;AreaCode&quot;, &quot;cellsalign&quot;: &quot;left&quot;, &quot;cellsformat&quot;: &quot;d&quot; }, { &quot;text&quot;: &quot;Revenue&quot;, &quot;dataField&quot;: &quot;Revenue&quot;, &quot;cellsalign&quot;: &quot;right&quot;, &quot;cellsformat&quot;: &quot;c2&quot; }],<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;float: left; width: 99.9%;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
    &lt;/div&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;select id=&quot;selectOptions&quot; onchange=&quot;applyNewCSS()&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Template&lt;/option&gt;<br />
        &lt;option value=&quot;metro&quot;&gt;metro&lt;/option&gt;<br />
        &lt;option value=&quot;office&quot;&gt;office&lt;/option&gt;<br />
        &lt;option value=&quot;orange&quot;&gt;orange&lt;/option&gt;<br />
        &lt;option value=&quot;energyblue&quot;&gt;energyblue&lt;/option&gt;<br />
        &lt;option value=&quot;darkblue&quot;&gt;darkblue&lt;/option&gt;<br />
        &lt;option value=&quot;shinyblack&quot;&gt;shinyblack&lt;/option&gt;<br />
        &lt;option value=&quot;lightness&quot; selected=&quot;selected&quot;&gt;lightness&lt;/option&gt;<br />
        &lt;option value=&quot;android&quot;&gt;android&lt;/option&gt;<br />
    &lt;/select&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Did you try jQWidget yet? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/change-themes-dynamically-in-grid/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
