<?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>jQWidget &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/tag/jqwidget/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Tue, 10 Jul 2018 11:49:45 +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>jQWidget &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Load Data To Grid On Sroll</title>
		<link>https://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/</link>
					<comments>https://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 02 Nov 2015 06:09:36 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[jQWidget]]></category>
		<category><![CDATA[Load data dynamically]]></category>
		<category><![CDATA[Load Data To Grid On Sroll]]></category>
		<category><![CDATA[rendergridrows]]></category>
		<category><![CDATA[virtualmode]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10886</guid>

					<description><![CDATA[In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per user request (on scrolling down). Sounds cool?. Normally what we do is, we will load all the data to the grid in a head shot, the problem in this manner is, it will take ages to load the full data to grid. Hence the user will close your application and the won&#8217;t return back. That is sad thing right? So we will concentrate on the performance part now. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I am working in a dashboard application. So for me performance was the main criteria to take care. We have used server side paging to improve the performance. This I will share in my next article. Now we will try to load a client side data on demand. Let us say when ever user scroll down. Sounds fine? Ok let us start then.</p>
<p><strong>Using the code</strong></p>
<p>To show this demo, I am using jQWidget jQX Grid control. If you are new to jQX Grid, you can find out some introduction here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidget JQX Grid</a></p>
<p>Now we are going to load the grid first. I hope you have already checked how to load the grid. Please see the below code. </p>
<p><em>Create an HTML page</em></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><em>Add the needed references</em></p>
<p>[html]<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.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.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;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Here comes the main part.</p>
<p><strong>Grid Settings or Grid Initialization</strong></p>
<p>[js]<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             // generate sample data.<br />
             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can find out in the above code we are generating the data dynamically using a <a href="http://sibeeshpassion.com/function-declaration-and-function-expression/" target="_blank">function declaration</a> <em>generatedata</em>. </p>
<p>Have you noticed that in the grid settings we have given <em>virtualmode: true</em>. This is very important. This property is meant to be used for handling the dynamic data in grid. </p>
<p>And another property you must be aware of is <em>rendergridrows: rendergridrows</em>. This means, we are rendering the grid data on demand. Like when user change the pager or scroll. So we are going to call our <em>generatedata</em> function in the <em>rendergridrows</em>. We are passing the start index and end index to the function, so that the dynamic data won&#8217;t be repeated.</p>
<p>[js]<br />
var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
[/js]</p>
<p>Once the data is ready, we will pass it to the source object and source object to dataAdapter and finally dataAdapter to grid.</p>
<p>Shall we check our output now? </p>
<p><strong>Output</strong></p>
<div id="attachment_10887" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-10887" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png" alt="Load Data On Scroll" width="650" height="369" class="size-full wp-image-10887" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-300x170.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-400x227.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10887" class="wp-caption-text">Load Data On Scroll</p></div>
<div id="attachment_10888" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png"><img decoding="async" aria-describedby="caption-attachment-10888" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png" alt="Load Data On Scroll" width="650" height="359" class="size-full wp-image-10888" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-300x166.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-400x221.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10888" class="wp-caption-text">Load Data On Scroll</p></div>
<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;Load Data To Grid On Scroll  &#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.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.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;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>     &lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? 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://mail.sibeeshpassion.com/load-data-to-grid-on-sroll/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change Header Names Dynamically In JQwidgets JQX grid</title>
		<link>https://mail.sibeeshpassion.com/change-header-names-dynamically-in-jqwidgets-jqx-grid/</link>
					<comments>https://mail.sibeeshpassion.com/change-header-names-dynamically-in-jqwidgets-jqx-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 28 Oct 2015 11:15:33 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Change Header Names Dynamically In JQwidgets JQX grid]]></category>
		<category><![CDATA[jQWidget]]></category>
		<category><![CDATA[JQXGrid]]></category>
		<category><![CDATA[setcolumnproperty JQX Grid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10850</guid>

					<description><![CDATA[In this post we will see how we can Change Header Names Dynamically In JQwidgets JQX grid. I recently came across a situation to change the grid&#8217;s header columns text should be changed dynamically, when ever user change a text box content. 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 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can Change Header Names Dynamically In JQwidgets JQX grid. I recently came across a situation to change the grid&#8217;s header columns text should be changed dynamically, when ever user change a text box content. 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>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 Header Names Dynamically In JQwidgets JQX 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.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.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;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&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 />
                //id: &#8216;id&#8217;,<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 />
                      pageable: true,<br />
                      filterable: true,<br />
                      sortable: true<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;h2&gt;Change Header Names Dynamically In JQwidgets JQX grid &#8211; Sibeesh Passion&lt;/h2&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&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_10851" style="width: 653px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid.png"><img decoding="async" aria-describedby="caption-attachment-10851" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid.png" alt="Change Header Names Dynamically In JQwidgets JQX grid" width="643" height="475" class="size-full wp-image-10851" srcset="/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid.png 643w, /wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid-300x222.png 300w, /wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid-400x295.png 400w" sizes="(max-width: 643px) 100vw, 643px" /></a><p id="caption-attachment-10851" class="wp-caption-text">Change Header Names Dynamically In JQwidgets JQX grid</p></div>
<p>Cool, so grid is loaded. Now need to add a select control in which we are going to load the grid header names so that user can select which one&#8217;s header must be changed, and a text box where a user can enter the text to be changed for the selected header. Is that fine?</p>
<p>[html]<br />
  &lt;select id=&quot;selectOptions&quot;&gt;&lt;/select&gt;<br />
    &lt;input type=&quot;text&quot; id=&quot;changeName&quot; /&gt;<br />
[/html]</p>
<p>The next thing is we need to add the options to the select control. Right? We can get the column properties of JQX grid as $(&#8220;#jqxgrid&#8221;).jqxGrid(&#8216;columns&#8217;).records. Now we will create a ready function in the grid settings and append the values. Following is the code for that.</p>
<p>[js]<br />
 ready: function () {<br />
                          var options = &quot;&lt;option value=&#8217;0&#8242;&gt;&#8211;Select Header&#8211;&lt;/option&gt;&quot;;<br />
                          var headerNames = $(&quot;#jqxgrid&quot;).jqxGrid(&#8216;columns&#8217;).records;<br />
                          for (var i = 0; i &lt; headerNames.length; i++) {<br />
                              options += &quot;&lt;option value = &#8216;&quot; + headerNames[i].datafield + &quot;&#8217;&gt;&quot; + headerNames[i].text + &quot; &lt;/option&gt;&quot;;<br />
                          }<br />
                          $(&quot;#selectOptions&quot;).html(options);<br />
                      }<br />
[/js]</p>
<p>What is next? Yeah, we need to fire the text box change event. </p>
<p>[js]<br />
$(&quot;#changeName&quot;).change(function (e) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid(&#8216;setcolumnproperty&#8217;, $(&#8216;#selectOptions option:selected&#8217;).val(), &#8216;text&#8217;, $(&#8216;#changeName&#8217;).val());<br />
            });<br />
[/js]</p>
<p>In the text box change event we have written the code to change the header column text property.</p>
<blockquote><p>Here we are using setcolumnproperty method which already available in the JQWidget library.</p></blockquote>
<p>Now it is time to see how it woks. </p>
<div id="attachment_10852" style="width: 654px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid_1.png"><img decoding="async" aria-describedby="caption-attachment-10852" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid_1.png" alt="Change Header Names Dynamically In JQwidgets JQX grid" width="644" height="567" class="size-full wp-image-10852" srcset="/wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid_1.png 644w, /wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid_1-300x264.png 300w, /wp-content/uploads/2015/10/Change_Header_Names_Dynamically_In_JQwidgets_JQX_grid_1-400x352.png 400w" sizes="(max-width: 644px) 100vw, 644px" /></a><p id="caption-attachment-10852" class="wp-caption-text">Change Header Names Dynamically In JQwidgets JQX grid</p></div>
<p>You can see that the header column text has been changed from &#8216;Area Code&#8217; to &#8216;New Area Code&#8217;.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 Header Names Dynamically In JQwidgets JQX 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.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.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;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&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 />
                //id: &#8216;id&#8217;,<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 />
                      pageable: true,<br />
                      filterable: true,<br />
                      sortable: true,<br />
                      ready: function () {<br />
                          var options = &quot;&lt;option value=&#8217;0&#8242;&gt;&#8211;Select Header&#8211;&lt;/option&gt;&quot;;<br />
                          var headerNames = $(&quot;#jqxgrid&quot;).jqxGrid(&#8216;columns&#8217;).records;<br />
                          for (var i = 0; i &lt; headerNames.length; i++) {<br />
                              options += &quot;&lt;option value = &#8216;&quot; + headerNames[i].datafield + &quot;&#8217;&gt;&quot; + headerNames[i].text + &quot; &lt;/option&gt;&quot;;<br />
                          }<br />
                          $(&quot;#selectOptions&quot;).html(options);<br />
                      }<br />
                  });<br />
            $(&quot;#changeName&quot;).change(function (e) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid(&#8216;setcolumnproperty&#8217;, $(&#8216;#selectOptions option:selected&#8217;).val(), &#8216;text&#8217;, $(&#8216;#changeName&#8217;).val());<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;h3&gt;Change Header Names Dynamically In JQwidgets JQX grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;select id=&quot;selectOptions&quot;&gt;&lt;/select&gt;<br />
    &lt;input type=&quot;text&quot; id=&quot;changeName&quot; /&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/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://mail.sibeeshpassion.com/change-header-names-dynamically-in-jqwidgets-jqx-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Order Filter Conditions In jQWidget JQX Grid</title>
		<link>https://mail.sibeeshpassion.com/order-filter-conditions-in-jqwidget-jqx-grid/</link>
					<comments>https://mail.sibeeshpassion.com/order-filter-conditions-in-jqwidget-jqx-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 20 Oct 2015 09:56:57 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Default Filter Condition in Grid Filter Dropdown]]></category>
		<category><![CDATA[jQWidget]]></category>
		<category><![CDATA[JQX Grid Filter]]></category>
		<category><![CDATA[Order Filter Conditions In jQWidget JQX Grid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10816</guid>

					<description><![CDATA[In this post we will see how we can set the default filter condition in JQX Grid filter drop down or how we can order jqx grid jqwidget filter conditions. I recently came across a situation that the grid filter condition must be shown as &#8216;equal&#8217; for any type of filter like string, numeric. 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: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can set the default filter condition in JQX Grid filter drop down or how we can order jqx grid jqwidget filter conditions. I recently came across a situation that the grid filter condition must be shown as &#8216;equal&#8217; for any type of filter like string, numeric. 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>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;Order Filter Conditions In JQX 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.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.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;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&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 />
                //id: &#8216;id&#8217;,<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 />
                      pageable: true,<br />
                      filterable: true,<br />
                      sortable: true<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;h2&gt;Order Filter Conditions In JQX Grid &#8211; Sibeesh Passion&lt;/h2&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&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_10817" style="width: 637px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid.png"><img decoding="async" aria-describedby="caption-attachment-10817" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid.png" alt="Order Filter Conditions In jQWidget JQX Grid" width="627" height="485" class="size-full wp-image-10817" srcset="/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid.png 627w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid-300x232.png 300w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid-400x309.png 400w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-10817" class="wp-caption-text">Order Filter Conditions In jQWidget JQX Grid</p></div>
<p>Cool, so grid is loaded. Now have you noticed that the filter condition shows by default is &#8216;Contains&#8217; ? Now we are going to change that. You might be thinking what kind of requirement is this. But trust me. If client ask, we must do anything at any cost. </p>
<p>Now we are going to add three functions to the grid settings. </p>
<li>rendered</li>
<li>updatefilterconditions</li>
<li>updatefilterpanel</li>
<p>So our grid settings will be looking as follows. </p>
<p>[js]<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 />
                      pageable: true,<br />
                      filterable: true,<br />
                      sortable: true,<br />
                      rendered: function () {<br />
                          var localizationobj = {};<br />
                          filterstringcomparisonoperators = [&#8216;equal&#8217;, &#8217;empty&#8217;, &#8216;not empty&#8217;, &#8216;contains&#8217;, &#8216;does not contain&#8217;, &#8216;starts with&#8217;, &#8216;ends with&#8217;, &#8216;null&#8217;];<br />
                          filternumericcomparisonoperators = [&#8216;equal&#8217;, &#8216;not equal&#8217;, &#8216;less than&#8217;, &#8216;less than or equal&#8217;, &#8216;greater than&#8217;, &#8216;greater than or equal&#8217;, &#8216;null&#8217;, &#8216;not null&#8217;];<br />
                          filterdatecomparisonoperators = [&#8216;equal&#8217;, &#8216;not equal&#8217;, &#8216;less than&#8217;, &#8216;less than or equal&#8217;, &#8216;greater than&#8217;, &#8216;greater than or equal&#8217;, &#8216;null&#8217;, &#8216;not null&#8217;];<br />
                          filterbooleancomparisonoperators = [&#8216;equal&#8217;, &#8216;not equal&#8217;];</p>
<p>                          localizationobj.filterstringcomparisonoperators = filterstringcomparisonoperators;<br />
                          localizationobj.filternumericcomparisonoperators = filternumericcomparisonoperators;<br />
                          localizationobj.filterdatecomparisonoperators = filterdatecomparisonoperators;<br />
                          localizationobj.filterbooleancomparisonoperators = filterbooleancomparisonoperators;</p>
<p>                          // apply localization.<br />
                          $(&quot;#jqxgrid&quot;).jqxGrid(&#8216;localizestrings&#8217;, localizationobj);<br />
                      },<br />
                      updatefilterconditions: function (type, defaultconditions) {<br />
                          var stringcomparisonoperators = [&#8216;EQUAL&#8217;, &#8216;EMPTY&#8217;, &#8216;NOT_EMPTY&#8217;, &#8216;CONTAINS&#8217;, &#8216;DOES_NOT_CONTAIN&#8217;, &#8216;STARTS_WITH&#8217;, &#8216;ENDS_WITH&#8217;, &#8216;NULL&#8217;];<br />
                          var numericcomparisonoperators = [&#8216;EQUAL&#8217;, &#8216;NOT_EQUAL&#8217;, &#8216;LESS_THAN&#8217;, &#8216;LESS_THAN_OR_EQUAL&#8217;, &#8216;GREATER_THAN&#8217;, &#8216;GREATER_THAN_OR_EQUAL&#8217;, &#8216;NULL&#8217;, &#8216;NOT_NULL&#8217;];<br />
                          var datecomparisonoperators = [&#8216;EQUAL&#8217;, &#8216;NOT_EQUAL&#8217;, &#8216;LESS_THAN&#8217;, &#8216;LESS_THAN_OR_EQUAL&#8217;, &#8216;GREATER_THAN&#8217;, &#8216;GREATER_THAN_OR_EQUAL&#8217;, &#8216;NULL&#8217;, &#8216;NOT_NULL&#8217;];<br />
                          var booleancomparisonoperators = [&#8216;EQUAL&#8217;, &#8216;NOT_EQUAL&#8217;];<br />
                          switch (type) {<br />
                              case &#8216;stringfilter&#8217;:<br />
                                  return stringcomparisonoperators;<br />
                              case &#8216;numericfilter&#8217;:<br />
                                  return numericcomparisonoperators;<br />
                              case &#8216;datefilter&#8217;:<br />
                                  return datecomparisonoperators;<br />
                              case &#8216;booleanfilter&#8217;:<br />
                                  return booleancomparisonoperators;<br />
                          }<br />
                      },<br />
                      updatefilterpanel: function (filtertypedropdown1, filtertypedropdown2, filteroperatordropdown, filterinputfield1, filterinputfield2, filterbutton, clearbutton,<br />
                           columnfilter, filtertype, filterconditions) {<br />
                          var index1 = 0;<br />
                          var index2 = 0;<br />
                          filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 });<br />
                          filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 });<br />
                      }<br />
                  });<br />
        });<br />
[/js]</p>
<p>Here in the <em>updatefilterpanel</em> we are setting the index for the filter drop down. And in <em>updatefilterconditions</em> and <em>rendered</em> functions we are applying the localization according to our requirement. Now save the changes and run your grid again, you can see the filter option &#8216;equal&#8217; will be loaded as default. </p>
<div id="attachment_10818" style="width: 622px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid1.png"><img decoding="async" aria-describedby="caption-attachment-10818" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid1.png" alt="Order Filter Conditions In jQWidget JQX Grid" width="612" height="470" class="size-full wp-image-10818" srcset="/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid1.png 612w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid1-300x230.png 300w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid1-400x307.png 400w" sizes="(max-width: 612px) 100vw, 612px" /></a><p id="caption-attachment-10818" class="wp-caption-text">Order Filter Conditions In jQWidget JQX Grid</p></div>
<div id="attachment_10819" style="width: 631px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid2.png"><img decoding="async" aria-describedby="caption-attachment-10819" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid2.png" alt="Order Filter Conditions In jQWidget JQX Grid" width="621" height="480" class="size-full wp-image-10819" srcset="/wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid2.png 621w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid2-300x232.png 300w, /wp-content/uploads/2015/10/Order_Filter_Conditions_In_jQWidget_JQX_Grid2-400x309.png 400w" sizes="(max-width: 621px) 100vw, 621px" /></a><p id="caption-attachment-10819" class="wp-caption-text">Order Filter Conditions In jQWidget JQX Grid</p></div>
<p>That&#8217;s all we have done this requirement of ordering the jQWidget JQX grid filter conditions. </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://mail.sibeeshpassion.com/order-filter-conditions-in-jqwidget-jqx-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
