<?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>Client Side Grid &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/client-side-grid/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Mon, 04 Jul 2016 12:17:27 +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>Client Side Grid &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Convert JSON Data Into Data Grid Columns</title>
		<link>https://www.sibeeshpassion.com/convert-json-data-into-data-grid-columns/</link>
					<comments>https://www.sibeeshpassion.com/convert-json-data-into-data-grid-columns/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 19 Jan 2016 09:00:37 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Bind JSON to Grid]]></category>
		<category><![CDATA[Client Side Grid]]></category>
		<category><![CDATA[Grid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11131</guid>

					<description><![CDATA[In this post we will see how we can show our JSON data in a client side grid. Here we are going to use jquery.columns grid, which is light weight and pretty easy to use. For the demo purpose we will create a JSON dynamically in client side and format it as a grid. I hope you will like this. Using the code First of all you need to download the needed files from here. Then add reference to your page. [html] &#60;link href=&#34;css/classic.css&#34; rel=&#34;stylesheet&#34; /&#62; &#60;script src=&#34;js/jquery.min.js&#34;&#62;&#60;/script&#62; &#60;script src=&#34;js/jquery.columns-1.0.min.js&#34;&#62;&#60;/script&#62; [/html] Creating a JSON dynamically You can create a JSON [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can show our JSON data in a client side grid. Here we are going to use <em>jquery.columns</em> grid, which is light weight and pretty easy to use. For the demo purpose we will create a JSON dynamically in client side and format it as a grid. I hope you will like this. </p>
<p><strong>Using the code</strong></p>
<p>First of all you need to download the needed files from <a href="http://www.jqueryscript.net/table/jQuery-Plugin-To-Convert-JSON-Data-Into-Data-Grid-Columns.html" target="_blank">here</a>.</p>
<p>Then add reference to your page.</p>
<p>[html]<br />
  &lt;link href=&quot;css/classic.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;script src=&quot;js/jquery.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;js/jquery.columns-1.0.min.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p><strong>Creating a JSON dynamically </strong></p>
<p>You can create a JSON array as follows. </p>
<p>[js]<br />
var myData = new Array();<br />
        var firstNames =<br />
        [<br />
            &quot;Andrew&quot;, &quot;Nancy&quot;, &quot;Shelley&quot;, &quot;Regina&quot;, &quot;Yoshi&quot;, &quot;Antoni&quot;, &quot;Mayumi&quot;, &quot;Ian&quot;, &quot;Peter&quot;, &quot;Lars&quot;, &quot;Petra&quot;, &quot;Martin&quot;, &quot;Sven&quot;, &quot;Elio&quot;, &quot;Beate&quot;, &quot;Cheryl&quot;, &quot;Michael&quot;, &quot;Guylene&quot;<br />
        ];<br />
        var lastNames =<br />
        [<br />
            &quot;Fuller&quot;, &quot;Davolio&quot;, &quot;Burke&quot;, &quot;Murphy&quot;, &quot;Nagase&quot;, &quot;Saavedra&quot;, &quot;Ohno&quot;, &quot;Devling&quot;, &quot;Wilson&quot;, &quot;Peterson&quot;, &quot;Winkler&quot;, &quot;Bein&quot;, &quot;Petersen&quot;, &quot;Rossi&quot;, &quot;Vileid&quot;, &quot;Saylor&quot;, &quot;Bjorn&quot;, &quot;Nodier&quot;<br />
        ];<br />
        var productNames =<br />
        [<br />
            &quot;Black Tea&quot;, &quot;Green Tea&quot;, &quot;Caffe Espresso&quot;, &quot;Doubleshot Espresso&quot;, &quot;Caffe Latte&quot;, &quot;White Chocolate Mocha&quot;, &quot;Cramel Latte&quot;, &quot;Caffe Americano&quot;, &quot;Cappuccino&quot;, &quot;Espresso Truffle&quot;, &quot;Espresso con Panna&quot;, &quot;Peppermint Mocha Twist&quot;<br />
        ];<br />
        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;1.75&quot;, &quot;3.25&quot;, &quot;4.0&quot;<br />
        ];<br />
 function createData(num) {<br />
            myData = [];<br />
            for (var i = 0; i &lt; num; 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);<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;<br />
                myData[i] = row;<br />
            }<br />
        }<br />
[/js]</p>
<p>Here the function <em>createData</em> will create a JSON array.</p>
<p>Next we need to create a table and give this array as a data source to the grid. </p>
<p>[html]<br />
&lt;table id=&quot;dataGrid&quot; class=&quot;display&quot; width=&quot;100%&quot;&gt;&lt;/table&gt;<br />
[/html]</p>
<p>[js]<br />
$(function () {<br />
            createData(25);<br />
            $(&#8216;#dataGrid&#8217;).columns({<br />
                data: myData<br />
            });<br />
        });<br />
[/js]</p>
<p>Pretty simple right? </p>
<p><strong>Complete code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Convert JSON Data Into Data Grid Columns&lt;/title&gt;<br />
    &lt;link href=&quot;css/classic.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;script src=&quot;js/jquery.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;js/jquery.columns-1.0.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        var myData = new Array();<br />
        var firstNames =<br />
        [<br />
            &quot;Andrew&quot;, &quot;Nancy&quot;, &quot;Shelley&quot;, &quot;Regina&quot;, &quot;Yoshi&quot;, &quot;Antoni&quot;, &quot;Mayumi&quot;, &quot;Ian&quot;, &quot;Peter&quot;, &quot;Lars&quot;, &quot;Petra&quot;, &quot;Martin&quot;, &quot;Sven&quot;, &quot;Elio&quot;, &quot;Beate&quot;, &quot;Cheryl&quot;, &quot;Michael&quot;, &quot;Guylene&quot;<br />
        ];<br />
        var lastNames =<br />
        [<br />
            &quot;Fuller&quot;, &quot;Davolio&quot;, &quot;Burke&quot;, &quot;Murphy&quot;, &quot;Nagase&quot;, &quot;Saavedra&quot;, &quot;Ohno&quot;, &quot;Devling&quot;, &quot;Wilson&quot;, &quot;Peterson&quot;, &quot;Winkler&quot;, &quot;Bein&quot;, &quot;Petersen&quot;, &quot;Rossi&quot;, &quot;Vileid&quot;, &quot;Saylor&quot;, &quot;Bjorn&quot;, &quot;Nodier&quot;<br />
        ];<br />
        var productNames =<br />
        [<br />
            &quot;Black Tea&quot;, &quot;Green Tea&quot;, &quot;Caffe Espresso&quot;, &quot;Doubleshot Espresso&quot;, &quot;Caffe Latte&quot;, &quot;White Chocolate Mocha&quot;, &quot;Cramel Latte&quot;, &quot;Caffe Americano&quot;, &quot;Cappuccino&quot;, &quot;Espresso Truffle&quot;, &quot;Espresso con Panna&quot;, &quot;Peppermint Mocha Twist&quot;<br />
        ];<br />
        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;1.75&quot;, &quot;3.25&quot;, &quot;4.0&quot;<br />
        ];<br />
        $(function () {<br />
            createData(25);<br />
            $(&#8216;#dataGrid&#8217;).columns({<br />
                data: myData<br />
            });<br />
        });<br />
        function createData(num) {<br />
            myData = [];<br />
            for (var i = 0; i &lt; num; 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);<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;<br />
                myData[i] = row;<br />
            }<br />
        }</p>
<p>    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;table id=&quot;dataGrid&quot; class=&quot;display&quot; width=&quot;100%&quot;&gt;&lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Output</strong></p>
<p>If everything goes fine, you can see as an output in your page. </p>
<div id="attachment_11132" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11132" src="http://sibeeshpassion.com/wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid-1024x184.png" alt="JSON Data Into Data Grid" width="634" height="114" class="size-large wp-image-11132" srcset="/wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid-1024x184.png 1024w, /wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid-300x54.png 300w, /wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid-768x138.png 768w, /wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid-400x72.png 400w, /wp-content/uploads/2016/01/JSON-Data-Into-Data-Grid.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11132" class="wp-caption-text">JSON Data Into Data Grid</p></div>
<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://www.sibeeshpassion.com/convert-json-data-into-data-grid-columns/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working With JQX Grid With Filtering And Sorting And Searching</title>
		<link>https://www.sibeeshpassion.com/working-with-jqx-grid-with-filtering-and-sorting/</link>
					<comments>https://www.sibeeshpassion.com/working-with-jqx-grid-with-filtering-and-sorting/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 29 Nov 2014 19:16:00 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Client Side Grid]]></category>
		<category><![CDATA[Create JQX grid]]></category>
		<category><![CDATA[Fastest Client Side Grid]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[Grid Data Source]]></category>
		<category><![CDATA[Grid With Filter]]></category>
		<category><![CDATA[Grid With Searching]]></category>
		<category><![CDATA[Grid With Sorting]]></category>
		<category><![CDATA[Load Grid]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=531</guid>

					<description><![CDATA[Introduction We have all worked with JQ Grid. Today I got a requirement to implement JQWidget JQX Grid in my web application. Here I will explain how to implement JQX Grid in our application. Download the needed files JQX Grid With Filtering And Sorting This article has been selected as Asp.Net Community Article of the Day Tuesday, December 30, 2014 (Working with JQX Grid with Filtering and Sorting and Searching) What you must know jQuery : What is jQuery? JavaScript : JavaScript Tutorial CSS 3 : CSS3 Introduction HTML : HTML(5) Tutorial DOM Manipulations in jQuery : jQuery – DOM [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>We have all worked with JQ Grid. Today I got a requirement to implement JQWidget JQX Grid in my web application. Here I will explain how to implement JQX Grid in our application.</p>
<p><strong>Download the needed files</strong></p>
<p><a href="https://github.com/Sibeesh/JQXGrid" target="_blank">JQX Grid With Filtering And Sorting</a></p>
<p><em>This article has been selected as Asp.Net Community Article of the Day Tuesday, December 30, 2014</em><br />
(Working with JQX Grid with Filtering and Sorting and Searching)</p>
<p><strong>What you must know</strong></p>
<p>jQuery : <a href="http://jquery.com/" target="_blank">What is jQuery?</a><br />
JavaScript : <a href="http://www.w3schools.com/js/" target="_blank">JavaScript Tutorial</a><br />
CSS 3 : <a href="http://www.w3schools.com/css/css3_intro.asp" target="_blank">CSS3 Introduction</a><br />
HTML : <a href="http://www.w3schools.com/html/" target="_blank">HTML(5) Tutorial</a><br />
DOM Manipulations in jQuery : <a href="http://www.tutorialspoint.com/jquery/jquery-dom.htm" target="_blank">jQuery – DOM Manipulation Methods</a></p>
<p><strong>Background</strong></p>
<p>We can implement the JQX Grid in MVC and in our web application. You can find the demo here: <a href="http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/filterconditions.htm" target="_blank">jqxGrid</a>.</p>
<p>You can download the necessary file from <a href="http://www.jqwidgets.com/download/" target="_blank">http://www.jqwidgets.com/download/</a>.</p>
<p><strong>What made me choose JQX Grid</strong></p>
<p>What made me choose JQX Grid? The answer is simple. We have so many client-side grid providers (JQGrid, Telerik, JQX and so on). If you are not aware of those, please have a look at:<a href="http://www.sitepoint.com/10-jquery-grids/" target="_blank">http://www.sitepoint.com/10-jquery-grids/</a></p>
<p>But for my requirements the client needs a toggle panel in which the filtering conditions occur. When I searched, JQX Grid has the best performance. (Some others support the same features, but they were a little slow.)</p>
<p><strong>Using the code</strong></p>
<p>There is a procedure we must follow to implement the JQX in our application.</p>
<p>Step 1</p>
<p>Download all the necessary files.</p>
<p>Step 2</p>
<p>Create a new web application.</p>
<div id="attachment_8871" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting.jpg"><img decoding="async" aria-describedby="caption-attachment-8871" src="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting.jpg" alt="Working With JQX Grid With Filtering And Sorting And Searching" width="650" height="766" class="size-full wp-image-8871" srcset="/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting.jpg 303w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting-255x300.jpg 255w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting-400x471.jpg 400w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting-509x600.jpg 509w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-8871" class="wp-caption-text">Working With JQX Grid With Filtering And Sorting And Searching</p></div>
<p>Step 3</p>
<p>Add the selected folders to your application.</p>
<div id="attachment_8881" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting2.jpg"><img decoding="async" aria-describedby="caption-attachment-8881" src="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting2.jpg" alt="Working With JQX Grid With Filtering And Sorting And Searching" width="650" height="346" class="size-full wp-image-8881" srcset="/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting2.jpg 634w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting2-300x160.jpg 300w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting2-400x213.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-8881" class="wp-caption-text">Working With JQX Grid With Filtering And Sorting And Searching</p></div>
<p>Step 4</p>
<p>Add a new page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
&lt;/head&gt;<br />
&lt;body &gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Step 5</p>
<p>Add the style sheets and necessary JavaScript files.<br />
[html]<br />
&lt;link rel=“stylesheet” href=“jqwidgets/styles/jqx.base.css” type=“text/css” /&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/jquery-1.11.1.min.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcore.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdata.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxbuttons.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxscrollbar.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxlistbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdropdownlist.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxmenu.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.filter.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.sort.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.selection.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxpanel.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcheckbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/demos.js”&gt;&lt;/script&gt;<br />
[/html]</p>
<p>(Make sure that you add the JavaScript files in order.)</p>
<p>Step 6</p>
<p>Create the DOM elements in which you want to show the JQX Grid.<br />
[html]<br />
&lt;div id=‘jqxWidget’ style=“font-size: 13px; font-family: Verdana; float: left;”&gt;<br />
       &lt;div id=“jqxgrid”&gt;<br />
       &lt;/div&gt;<br />
   &lt;/div&gt;<br />
[/html]</p>
<p>Step 7</p>
<p>Generate some dynamic JSON data so that you can easily generate the JQX Grid. You can get the data from the database and convert it to JSON. If you are unfamiliar with how to convert JSON then you can get it here: <a href="https://www.nuget.org/packages/newtonsoft.json/" target="_blank">Json.NET 6.0.6.</a></p>
<p>If you are not aware of how to add the newtonsoft and use it then please see this video. And please dont forget to rate his video. He has done good a job :).</p>
<p><a href="https://www.youtube.com/watch?v=76blDatESaA" target="_blank">JSON Serialization and DeSerialization</a></p>
<p>Here I am generating data dynamically in a JavaScript file. Please find the generatedata.js file in the bundle of the JQX Grid. Please add this to your script section.<br />
[js]<br />
&lt;script src=“generatedata.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>If you go into the <em>generatedata.js</em>, you can see a function generatedata, that is for creating the data (JSON array) dynamically .<br />
[js]<br />
function generatedata(rowscount, hasNullValues) {<br />
    // prepare the data<br />
    var data = new Array();<br />
    if (rowscount == #ff0000) rowscount = 100;<br />
    var firstNames =<br />
    [<br />
        “Andrew”, “Nancy”, “Shelley”, “Regina”, “Yoshi”, “Antoni”, “Mayumi”, “Ian”, “Peter”, “Lars”, “Petra”, “Martin”, “Sven”, “Elio”, “Beate”, “Cheryl”, “Michael”, “Guylene”<br />
    ];<br />
    var lastNames =<br />
    [<br />
        “Fuller”, “Davolio”, “Burke”, “Murphy”, “Nagase”, “Saavedra”, “Ohno”, “Devling”, “Wilson”, “Peterson”, “Winkler”, “Bein”, “Petersen”, “Rossi”, “Vileid”, “Saylor”, “Bjorn”, “Nodier”<br />
    ];<br />
    var productNames =<br />
    [<br />
        “Black Tea”, “Green Tea”, “Caffe Espresso”, “Doubleshot Espresso”, “Caffe Latte”, “White Chocolate Mocha”, “Caramel Latte”, “Caffe Americano”, “Cappuccino”, “Espresso Truffle”, “Espresso con Panna”, “Peppermint Mocha Twist”<br />
    ];<br />
    var priceValues =<br />
    [<br />
         “2.25”, “1.5”, “3.0”, “3.3”, “4.5”, “3.6”, “3.8”, “2.5”, “5.0”, “1.75”, “3.25”, “4.0”<br />
    ];<br />
    for (var i = 0; i &lt; rowscount; 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);<br />
        row[“id”] = i;<br />
        row[“available”] = productindex % 2 == 0;<br />
        if (hasNullValues == true) {<br />
            if (productindex % 2 != 0) {<br />
                var random = Math.floor(Math.random() * rowscount);<br />
                row[“available”] = i % random == 0 ? null : false;<br />
            }<br />
        }<br />
        row[“firstname”] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
        row[“lastname”] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
        row[“name”] = row[“firstname”] + ” “ + row[“lastname”];<br />
        row[“productname”] = productNames[productindex];<br />
        row[“price”] = price;<br />
        row[“quantity”] = quantity;<br />
        row[“total”] = price * quantity;<br />
        var date = new Date();<br />
        date.setFullYear(2014, Math.floor(Math.random() * 12), Math.floor(Math.random() * 27));<br />
        date.setHours(0, 0, 0, 0);<br />
        row[“date”] = date;<br />
        data[i] = row;<br />
    }<br />
    return data;<br />
}<br />
[/js]</p>
<p>Step 8 </p>
<p>Now here is the main part. Add the main code to your script tag in the page. Here we are appending the Grid to the element that has the id jqxgrid.<br />
[js]<br />
&lt;script type=“text/javascript”&gt;<br />
        $(document).ready(function () {<br />
            var data = generatedata(500);<br />
            var source =<br />
            {<br />
                localdata: data,<br />
                datafields:<br />
                [<br />
                    { name: ‘firstname’, type: ‘string’ },<br />
                    { name: ‘lastname’, type: ‘string’ },<br />
                    { name: ‘productname’, type: ‘string’ },<br />
                    { name: ‘date’, type: ‘date’ },<br />
                    { name: ‘quantity’, type: ‘number’ }<br />
                ],<br />
                datatype: “array”<br />
            };<br />
            var addfilter = function () {<br />
                var filtergroup = new $.jqx.filter();<br />
                var filter_or_operator = 1;<br />
                var filtervalue = ‘Beate’;<br />
                var filtercondition = ‘contains’;<br />
                var filter1 = filtergroup.createfilter(‘stringfilter’, filtervalue, filtercondition);<br />
                filtervalue = ‘Andrew’;<br />
                filtercondition = ‘contains’;<br />
                var filter2 = filtergroup.createfilter(‘stringfilter’, filtervalue, filtercondition);<br />
                filtergroup.addfilter(filter_or_operator, filter1);<br />
                filtergroup.addfilter(filter_or_operator, filter2);<br />
                // add the filters.<br />
                $(“#jqxgrid”).jqxGrid(‘addfilter’, ‘firstname’, filtergroup);<br />
                // apply the filters.<br />
                $(“#jqxgrid”).jqxGrid(‘applyfilters’);<br />
            }<br />
            var dataAdapter = new $.jqx.dataAdapter(source);<br />
            $(“#jqxgrid”).jqxGrid(<br />
            {<br />
                width: 850,<br />
                source: dataAdapter,<br />
                filterable: true,<br />
                sortable: true,<br />
                autoshowfiltericon: true,<br />
                ready: function () {<br />
                    addfilter();<br />
                    var localizationObject = {<br />
                        filterstringcomparisonoperators: [‘contains’, ‘does not contain’],<br />
                        // filter numeric comparison operators.<br />
                        filternumericcomparisonoperators: [‘less than’, ‘greater than’],<br />
                        // filter date comparison operators.<br />
                        filterdatecomparisonoperators: [‘less than’, ‘greater than’],<br />
                        // filter bool comparison operators.<br />
                        filterbooleancomparisonoperators: [‘equal’, ‘not equal’]<br />
                    }<br />
                    $(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationObject);<br />
                },<br />
                updatefilterconditions: function (type, defaultconditions) {<br />
                    var stringcomparisonoperators = [‘CONTAINS’, ‘DOES_NOT_CONTAIN’];<br />
                    var numericcomparisonoperators = [‘LESS_THAN’, ‘GREATER_THAN’];<br />
                    var datecomparisonoperators = [‘LESS_THAN’, ‘GREATER_THAN’];<br />
                    var booleancomparisonoperators = [‘EQUAL’, ‘NOT_EQUAL’];<br />
                    switch (type) {<br />
                        case ‘stringfilter’:<br />
                            return stringcomparisonoperators;<br />
                        case ‘numericfilter’:<br />
                            return numericcomparisonoperators;<br />
                        case ‘datefilter’:<br />
                            return datecomparisonoperators;<br />
                        case ‘booleanfilter’:<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 />
                    if (columnfilter != null) {<br />
                        var filter1 = columnfilter.getfilterat(0);<br />
                        var filter2 = columnfilter.getfilterat(1);<br />
                        if (filter1) {<br />
                            index1 = filterconditions.indexOf(filter1.comparisonoperator);<br />
                            var value1 = filter1.filtervalue;<br />
                            filterinputfield1.val(value1);<br />
                        }<br />
                        if (filter2) {<br />
                            index2 = filterconditions.indexOf(filter2.comparisonoperator);<br />
                            var value2 = filter2.filtervalue;<br />
                            filterinputfield2.val(value2);<br />
                        }<br />
                    }<br />
                    filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 });<br />
                    filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 });<br />
                },<br />
                columns: [<br />
                  { text: ‘First Name’, datafield: ‘firstname’, width: 200 },<br />
                  { text: ‘Last Name’, datafield: ‘lastname’, width: 200 },<br />
                  { text: ‘Product’, datafield: ‘productname’, width: 180 },<br />
                  { text: ‘Order Date’, datafield: ‘date’, width: 160, cellsformat: ‘dd-MMMM-yyyy’ },<br />
                  { text: ‘Quantity’, datafield: ‘quantity’, cellsalign: ‘right’ }<br />
                ]<br />
            });<br />
            $(‘#events’).jqxPanel({ width: 300, height: 80});<br />
            $(“#jqxgrid”).on(“filter”, function (event) {<br />
                $(“#events”).jqxPanel(‘clearcontent’);<br />
                var filterinfo = $(“#jqxgrid”).jqxGrid(‘getfilterinformation’);<br />
                var eventData = “Triggered ‘filter’ event”;<br />
                for (i = 0; i &lt; filterinfo.length; i++) {<br />
                    var eventData = “Filter Column: “ + filterinfo[i].filtercolumntext;<br />
                    $(‘#events’).jqxPanel(‘prepend’, ‘&lt;div style=”margin-top: 5px;”&gt;’ + eventData + ‘&lt;/div&gt;’);<br />
                }<br />
            });<br />
            $(‘#clearfilteringbutton’).jqxButton({ theme: theme });<br />
            $(‘#filterbackground’).jqxCheckBox({ checked: true, height: 25});<br />
            $(‘#filtericons’).jqxCheckBox({ checked: false, height: 25});<br />
            // clear the filtering.<br />
            $(‘#clearfilteringbutton’).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘clearfilters’);<br />
            });<br />
            // show/hide filter background<br />
            $(‘#filterbackground’).on(‘change’, function (event) {<br />
                $(“#jqxgrid”).jqxGrid({ showfiltercolumnbackground: event.args.checked });<br />
            });<br />
            // show/hide filter icons<br />
            $(‘#filtericons’).on(‘change’, function (event) {<br />
                $(“#jqxgrid”).jqxGrid({ autoshowfiltericon: !event.args.checked });<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Step 9: Now build and run your code, you will get output as in the following:</p>
<div id="attachment_8891" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting3.jpg"><img decoding="async" aria-describedby="caption-attachment-8891" src="http://sibeeshpassion.com/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting3.jpg" alt="Working With JQX Grid With Filtering And Sorting And Searching" width="650" height="314" class="size-full wp-image-8891" srcset="/wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting3.jpg 634w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting3-300x145.jpg 300w, /wp-content/uploads/2014/11/working-with-jqx-grid-with-filtering-and-sorting3-400x193.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-8891" class="wp-caption-text">Working With JQX Grid With Filtering And Sorting And Searching</p></div>
<p>Have a happy coding 🙂</p>
<p><strong>History</strong></p>
<p>First version on: 13-Oct-2014 10:30 PM.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/working-with-jqx-grid-with-filtering-and-sorting/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Advanced JQX Grid With All Functionality</title>
		<link>https://www.sibeeshpassion.com/advanced-jqx-grid-with-all-functionality/</link>
					<comments>https://www.sibeeshpassion.com/advanced-jqx-grid-with-all-functionality/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Oct 2014 19:05:41 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Advanced Grid]]></category>
		<category><![CDATA[Client Side Grid]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[HTML Grid]]></category>
		<category><![CDATA[JQwidget Property]]></category>
		<category><![CDATA[JSON Grid]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=431</guid>

					<description><![CDATA[In this article we will see how we can implement or create a JQWidget&#8217;s JQX grid in our application. It is a client side grid which is good in performance and speed. We will see the advanced properties of a JQWidget JQX gris in this article. This article has been selected as Asp.Net Community Article of the Day Sunday January 11 ,2015. If you are new to the term JQX Grid then please find out the articles related to JQWidget category here: http://sibeeshpassion.com/category/products/jqwidgets/ If you need to bind the data source dynamically, please read here: http://sibeeshpassion.com/Convert-CellSet-to-HTML-table-And-From-HTML-To-Json-To-Array. For the past days [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we will see how we can implement or create a JQWidget&#8217;s JQX grid in our application. It is a client side grid which is good in performance and speed. We will see the advanced properties of a JQWidget JQX gris in this article.</p>
<p><em>This article has been selected as <a href="http://asp.net/community/articles" target="_blank">Asp.Net Community Article of the Day</a> Sunday January 11 ,2015.</em></p>
<p>If you are new to the term JQX Grid then please find out the articles related to JQWidget category here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">http://sibeeshpassion.com/category/products/jqwidgets/</a></p>
<p>If you need to bind the data source dynamically, please read here: <a href="http://sibeeshpassion.com/Convert-CellSet-to-HTML-table-And-From-HTML-To-Json-To-Array" target="_blank">http://sibeeshpassion.com/Convert-CellSet-to-HTML-table-And-From-HTML-To-Json-To-Array</a>. For the past days I have been working on JQX Grid. Now I will share that Grid with all the functionality.</p>
<p><strong>Download the source code</strong></p>
<li><a href="https://code.msdn.microsoft.com/Advanced-JQX-Grid-With-All-37dccb56" target="_blank">Advanced JQXGrid </a></li>
<p><strong>Background</strong></p>
<p>In my previous article, one member asked for some functionality. So I thought of sharing that info. Please note that I have not implemented all the functionalities. I have selected some important features that we may use in our programming life.</p>
<p><strong>Using the code</strong></p>
<p>As we discussed in the previous articles, we need a web application with all the contents of JQX Widgets (<a href="http://sibeeshpassion.com/working-with-jqx-grid-with-filtering-and-sorting/" target="_blank">http://sibeeshpassion.com/working-with-jqx-grid-with-filtering-and-sorting/</a> ).</p>
<p><strong>What is JQX Grid?</strong></p>
<p>jqxGrid is powerful datagrid widget built entirely with open web standards. It offers rich functionality, easy to use APIs and works across devices and browsers. jqxGrid delivers advanced data visualization features and built-in support for client and server-side paging, editing, sorting and filtering.</p>
<p><strong>What we need?</strong></p>
<p><em>Simple HTML</em><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=“en”&gt;<br />
   &lt;head&gt;<br />
       &lt;title&gt;&lt;/title&gt;<br />
   &lt;/head&gt;<br />
   &lt;body&gt;<br />
   &lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Include the extra UI elements</strong><br />
[html]<br />
&lt;body class=‘default’&gt;<br />
    &lt;div id=‘jqxWidget’ style=“font-size: 13px; font-family: Verdana; float: left;”&gt;<br />
        &lt;div id=“jqxgrid”&gt;&lt;/div&gt;<br />
        &lt;div style=‘margin-top: 20px;’&gt;<br />
            &lt;div style=‘float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to Excel” id=‘excelExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to XML” id=‘xmlExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to CSV” id=‘csvExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to TSV” id=‘tsvExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to HTML” id=‘htmlExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to JSON” id=‘jsonExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Print” id=‘print’ /&gt;<br />
            &lt;/div&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p><strong>Include Reference</strong></p>
<p>[html]<br />
&lt;link rel=“stylesheet” href=“jqwidgets/styles/jqx.base.css” type=“text/css” /&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/jquery-1.11.1.min.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcore.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdata.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxbuttons.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxscrollbar.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxlistbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdropdownlist.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxmenu.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.filter.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.sort.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.selection.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxpanel.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcheckbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/demos.js”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.pager.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.edit.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.columnsresize.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.columnsreorder.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxdata.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/html]</p>
<p><strong>What we add new?</strong><br />
[js]<br />
&lt;script src=“jqwidgets/jqxgrid.pager.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>This script is for adding the functionality of Paging :). You can add the functionality to the grid as<br />
[js]<br />
pageable: true.<br />
[/js]</p>
<p>And if you want different stylish paging then you can set that like this:<br />
[js]<br />
pagermode: ‘simple’,<br />
[/js]<br />
[js]<br />
&lt;script src=“jqwidgets/jqxgrid.edit.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>This script is for adding the functionality of Editing :). You can add the functionality to the grid as<br />
[js]<br />
editable: true.<br />
[/js]<br />
[js]<br />
&lt;script src=“jqwidgets/jqxgrid.columnsresize.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
&lt;script src=“jqwidgets/jqxgrid.columnsreorder.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>These scripts are for adding the functionality of Hierarchy columns. If we want to separate the data in the column header then you can include the following scripts.<br />
[js]<br />
&lt;script src=“jqwidgets/jqxgrid.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
&lt;script src=“jqwidgets/jqxdata.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>When you want to export your grid to any formate, please include those scripts. You can implement the same just like the following:<br />
[js]<br />
$(“#excelExport”).jqxButton({ theme: theme }); //Assign styles to the button<br />
            $(“#xmlExport”).jqxButton({ theme: theme });<br />
            $(“#csvExport”).jqxButton({ theme: theme });<br />
            $(“#tsvExport”).jqxButton({ theme: theme });<br />
            $(“#htmlExport”).jqxButton({ theme: theme });<br />
            $(“#jsonExport”).jqxButton({ theme: theme });<br />
            $(“#excelExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’); // To export to xlx<br />
            });<br />
            $(“#xmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xml’, ‘jqxGrid’); //To export to XML<br />
            });<br />
            $(“#csvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘csv’, ‘jqxGrid’); // To export to csv<br />
            });<br />
            $(“#tsvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘tsv’, ‘jqxGrid’); // To export to tsv<br />
            });<br />
            $(“#htmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’, ‘jqxGrid’); // To export to html<br />
            });<br />
            $(“#jsonExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’, ‘jqxGrid’); // To export to JSON<br />
            });<br />
[/js]</p>
<p>If you want to print your grid:<br />
[js]<br />
$(“#print”).jqxButton();<br />
            $(“#print”).click(function () {<br />
                var gridContent = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’);<br />
                var newWindow = window.open(”, ”, ‘width=800, height=500′),<br />
                document = newWindow.document.open(),<br />
                pageContent =<br />
                    ‘&lt;!DOCTYPE html&gt;\n’ +<br />
                    ‘&lt;html&gt;\n’ +<br />
                    ‘&lt;head&gt;\n’ +<br />
                    ‘&lt;meta charset=”utf-8″ /&gt;\n’ +<br />
                    ‘&lt;title&gt;jQWidgets Grid&lt;/title&gt;\n’ +<br />
                    ‘&lt;/head&gt;\n’ +<br />
                    ‘&lt;body&gt;\n’ + gridContent + ‘\n&lt;/body&gt;\n&lt;/html&gt;’;<br />
                document.write(pageContent);<br />
                document.close();<br />
                newWindow.print();<br />
            });<br />
[/js]</p>
<p>Now we need data to populate the grid, right? Since we are familiar with a simple header JQX Grid from the previous article, now we can go for a hierarchy column grid. So let’s say we have XML as follows:</p>
<p>[xml]<br />
&lt;DATA&gt;<br />
    &lt;ROW&gt;<br />
        &lt;ProductID&gt;72&lt;/ProductID&gt;<br />
        &lt;SupplierName&gt;Formaggi Fortini s.r.l.&lt;/SupplierName&gt;<br />
        &lt;Quantity&gt;24 – 200 g pkgs.&lt;/Quantity&gt;<br />
        &lt;Freight&gt;32.3800&lt;/Freight&gt;<br />
        &lt;OrderDate&gt;1996-07-04 00:00:00&lt;/OrderDate&gt;<br />
        &lt;OrderAddress&gt;59 rue de l-Abbaye&lt;/OrderAddress&gt;<br />
        &lt;Price&gt;34.8000&lt;/Price&gt;<br />
        &lt;City&gt;Ravenna&lt;/City&gt;<br />
        &lt;Address&gt;Viale Dante, 75&lt;/Address&gt;<br />
        &lt;ProductName&gt;Mozzarella di Giovanni&lt;/ProductName&gt;<br />
    &lt;/ROW&gt;<br />
    &lt;ROW&gt;<br />
        &lt;ProductID&gt;42&lt;/ProductID&gt;<br />
        &lt;SupplierName&gt;Leka Trading&lt;/SupplierName&gt;<br />
        &lt;Quantity&gt;32 – 1 kg pkgs.&lt;/Quantity&gt;<br />
        &lt;Freight&gt;32.3800&lt;/Freight&gt;<br />
        &lt;OrderDate&gt;1996-07-04 00:00:00&lt;/OrderDate&gt;<br />
        &lt;OrderAddress&gt;59 rue de l-Abbaye&lt;/OrderAddress&gt;<br />
        &lt;Price&gt;14.0000&lt;/Price&gt;<br />
        &lt;City&gt;Singapore&lt;/City&gt;<br />
        &lt;Address&gt;471 Serangoon Loop, Suite #402&lt;/Address&gt;<br />
        &lt;ProductName&gt;Singaporean Hokkien Fried Mee&lt;/ProductName&gt;<br />
    &lt;/ROW&gt;<br />
    &lt;ROW&gt;<br />
        ……..<br />
    &lt;/ROW&gt;<br />
    &lt;ROW&gt;<br />
       ……..<br />
    &lt;/ROW&gt;<br />
&lt;/DATA&gt;<br />
[/xml]</p>
<p>Please find the <em>orderdetailsextended.xml</em> from the source.</p>
<p><strong>Implementing a JQX GRid with advanced features</strong><br />
[js]<br />
&lt;script type=“text/javascript”&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var source =<br />
            {<br />
                datatype: “xml”,<br />
                datafields: [<br />
                     { name: ‘SupplierName’, type: ‘string’ },<br />
                     { name: ‘Quantity’, type: ‘number’ },<br />
                     { name: ‘OrderDate’, type: ‘date’ },<br />
                     { name: ‘OrderAddress’, type: ‘string’ },<br />
                     { name: ‘Freight’, type: ‘number’ },<br />
                     { name: ‘Price’, type: ‘number’ },<br />
                     { name: ‘City’, type: ‘string’ },<br />
                     { name: ‘ProductName’, type: ‘string’ },<br />
                     { name: ‘Address’, type: ‘string’ }<br />
                ],<br />
                url: ‘orderdetailsextended.xml’,<br />
                root: ‘DATA’,<br />
                record: ‘ROW’<br />
            };<br />
             var dataAdapter = new $.jqx.dataAdapter(source, {<br />
                 loadComplete: function () {<br />
                 }<br />
             });<br />
             // create jqxgrid.<br />
             $(“#jqxgrid”).jqxGrid(<br />
            {<br />
                width: 900,<br />
                source: dataAdapter,<br />
                filterable: true,<br />
                sortable: true,<br />
                pageable: true,<br />
                autorowheight: true,<br />
                altrows: true,<br />
                columnsresize: true,<br />
                columns: [<br />
                  { text: ‘Supplier Name’, cellsalign: ‘center’, align: ‘center’, datafield: ‘SupplierName’, width: 110 },<br />
                  { text: ‘Name’, columngroup: ‘ProductDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘ProductName’, width: 120 },<br />
                  { text: ‘Quantity’, columngroup: ‘ProductDetails’, datafield: ‘Quantity’, cellsformat: ‘d’, cellsalign: ‘center’, align: ‘center’, width: 80 },<br />
                  { text: ‘Freight’, columngroup: ‘OrderDetails’, datafield: ‘Freight’, cellsformat: ‘d’, cellsalign: ‘center’, align: ‘center’, width: 100 },<br />
                  { text: ‘Order Date’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, cellsformat: ‘d’, datafield: ‘OrderDate’, width: 100 },<br />
                  { text: ‘Order Address’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘OrderAddress’, width: 100 },<br />
                  { text: ‘Price’, columngroup: ‘ProductDetails’, datafield: ‘Price’, cellsformat: ‘c2′, align: ‘center’, cellsalign: ‘center’, width: 70 },<br />
                  { text: ‘Address’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘Address’, width: 120 },<br />
                  { text: ‘City’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘City’, width: 80 }<br />
                ],<br />
                columngroups:<br />
                [<br />
                  { text: ‘Product Details’, align: ‘center’, name: ‘ProductDetails’ },<br />
                  { text: ‘Order Details’, parentgroup: ‘ProductDetails’, align: ‘center’, name: ‘OrderDetails’ },<br />
                  { text: ‘Location’, align: ‘center’, name: ‘Location’ }<br />
                ]<br />
            });<br />
            $(“#excelExport”).jqxButton({ theme: theme });<br />
            $(“#xmlExport”).jqxButton({ theme: theme });<br />
            $(“#csvExport”).jqxButton({ theme: theme });<br />
            $(“#tsvExport”).jqxButton({ theme: theme });<br />
            $(“#htmlExport”).jqxButton({ theme: theme });<br />
            $(“#jsonExport”).jqxButton({ theme: theme });<br />
            $(“#excelExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’);<br />
            });<br />
            $(“#xmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xml’, ‘jqxGrid’);<br />
            });<br />
            $(“#csvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘csv’, ‘jqxGrid’);<br />
            });<br />
            $(“#tsvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘tsv’, ‘jqxGrid’);<br />
            });<br />
            $(“#htmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’, ‘jqxGrid’);<br />
            });<br />
            $(“#jsonExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’, ‘jqxGrid’);<br />
            });<br />
            $(“#print”).jqxButton();<br />
            $(“#print”).click(function () {<br />
                var gridContent = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’);<br />
                var newWindow = window.open(”, ”, ‘width=800, height=500′),<br />
                document = newWindow.document.open(),<br />
                pageContent =<br />
                    ‘&lt;!DOCTYPE html&gt;\n’ +<br />
                    ‘&lt;html&gt;\n’ +<br />
                    ‘&lt;head&gt;\n’ +<br />
                    ‘&lt;meta charset=”utf-8″ /&gt;\n’ +<br />
                    ‘&lt;title&gt;jQWidgets Grid&lt;/title&gt;\n’ +<br />
                    ‘&lt;/head&gt;\n’ +<br />
                    ‘&lt;body&gt;\n’ + gridContent + ‘\n&lt;/body&gt;\n&lt;/html&gt;’;<br />
                document.write(pageContent);<br />
                document.close();<br />
                newWindow.print();<br />
            });<br />
         });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>In the preceding script you can see a code part as follows:<br />
[js]<br />
columngroups:<br />
               [<br />
                  { text: ‘Product Details’, align: ‘center’, name: ‘ProductDetails’ },<br />
                  { text: ‘Order Details’, parentgroup: ‘ProductDetails’, align: ‘center’, name: ‘OrderDetails’ },<br />
                  { text: ‘Location’, align: ‘center’, name: ‘Location’ }<br />
               ]<br />
[/js]</p>
<p>This is where the column grouping is happening. And if you want to add a column under this column you can set that as follows:<br />
[js]<br />
{ text: ‘Name’, columngroup: ‘ProductDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘ProductName’, width: 120 }<br />
[/js]</p>
<p>You can specify this as needed and your data source.Now this is how our page looks like.<br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=“en”&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
    &lt;link rel=“stylesheet” href=“jqwidgets/styles/jqx.base.css” type=“text/css” /&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/jquery-1.11.1.min.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcore.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdata.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxbuttons.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxscrollbar.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxlistbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxdropdownlist.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxmenu.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.filter.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.sort.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxgrid.selection.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxpanel.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“jqwidgets/jqxcheckbox.js”&gt;&lt;/script&gt;<br />
    &lt;script type=“text/javascript” src=“scripts/demos.js”&gt;&lt;/script&gt;<br />
    &lt;script src=“generatedata.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.pager.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.edit.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.columnsresize.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.columnsreorder.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxgrid.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
    &lt;script src=“jqwidgets/jqxdata.export.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
     &lt;script type=“text/javascript”&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var source =<br />
            {<br />
                datatype: “xml”,<br />
                datafields: [<br />
                     { name: ‘SupplierName’, type: ‘string’ },<br />
                     { name: ‘Quantity’, type: ‘number’ },<br />
                     { name: ‘OrderDate’, type: ‘date’ },<br />
                     { name: ‘OrderAddress’, type: ‘string’ },<br />
                     { name: ‘Freight’, type: ‘number’ },<br />
                     { name: ‘Price’, type: ‘number’ },<br />
                     { name: ‘City’, type: ‘string’ },<br />
                     { name: ‘ProductName’, type: ‘string’ },<br />
                     { name: ‘Address’, type: ‘string’ }<br />
                ],<br />
                url: ‘orderdetailsextended.xml’,<br />
                root: ‘DATA’,<br />
                record: ‘ROW’<br />
            };<br />
             var dataAdapter = new $.jqx.dataAdapter(source, {<br />
                 loadComplete: function () {<br />
                 }<br />
             });<br />
             // create jqxgrid.<br />
             $(“#jqxgrid”).jqxGrid(<br />
            {<br />
                width: 900,<br />
                source: dataAdapter,<br />
                filterable: true,<br />
                sortable: true,<br />
                pageable: true,<br />
                autorowheight: true,<br />
                altrows: true,<br />
                columnsresize: true,<br />
                columns: [<br />
                  { text: ‘Supplier Name’, cellsalign: ‘center’, align: ‘center’, datafield: ‘SupplierName’, width: 110 },<br />
                  { text: ‘Name’, columngroup: ‘ProductDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘ProductName’, width: 120 },<br />
                  { text: ‘Quantity’, columngroup: ‘ProductDetails’, datafield: ‘Quantity’, cellsformat: ‘d’, cellsalign: ‘center’, align: ‘center’, width: 80 },<br />
                  { text: ‘Freight’, columngroup: ‘OrderDetails’, datafield: ‘Freight’, cellsformat: ‘d’, cellsalign: ‘center’, align: ‘center’, width: 100 },<br />
                  { text: ‘Order Date’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, cellsformat: ‘d’, datafield: ‘OrderDate’, width: 100 },<br />
                  { text: ‘Order Address’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘OrderAddress’, width: 100 },<br />
                  { text: ‘Price’, columngroup: ‘ProductDetails’, datafield: ‘Price’, cellsformat: ‘c2′, align: ‘center’, cellsalign: ‘center’, width: 70 },<br />
                  { text: ‘Address’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘Address’, width: 120 },<br />
                  { text: ‘City’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘City’, width: 80 }<br />
                ],<br />
                columngroups:<br />
                [<br />
                  { text: ‘Product Details’, align: ‘center’, name: ‘ProductDetails’ },<br />
                  { text: ‘Order Details’, parentgroup: ‘ProductDetails’, align: ‘center’, name: ‘OrderDetails’ },<br />
                  { text: ‘Location’, align: ‘center’, name: ‘Location’ }<br />
                ]<br />
            });<br />
            $(“#excelExport”).jqxButton({ theme: theme });<br />
            $(“#xmlExport”).jqxButton({ theme: theme });<br />
            $(“#csvExport”).jqxButton({ theme: theme });<br />
            $(“#tsvExport”).jqxButton({ theme: theme });<br />
            $(“#htmlExport”).jqxButton({ theme: theme });<br />
            $(“#jsonExport”).jqxButton({ theme: theme });<br />
            $(“#excelExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’);<br />
            });<br />
            $(“#xmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xml’, ‘jqxGrid’);<br />
            });<br />
            $(“#csvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘csv’, ‘jqxGrid’);<br />
            });<br />
            $(“#tsvExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘tsv’, ‘jqxGrid’);<br />
            });<br />
            $(“#htmlExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’, ‘jqxGrid’);<br />
            });<br />
            $(“#jsonExport”).click(function () {<br />
                $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’, ‘jqxGrid’);<br />
            });<br />
            $(“#print”).jqxButton();<br />
            $(“#print”).click(function () {<br />
                var gridContent = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘html’);<br />
                var newWindow = window.open(”, ”, ‘width=800, height=500′),<br />
                document = newWindow.document.open(),<br />
                pageContent =<br />
                    ‘&lt;!DOCTYPE html&gt;\n’ +<br />
                    ‘&lt;html&gt;\n’ +<br />
                    ‘&lt;head&gt;\n’ +<br />
                    ‘&lt;meta charset=”utf-8″ /&gt;\n’ +<br />
                    ‘&lt;title&gt;jQWidgets Grid&lt;/title&gt;\n’ +<br />
                    ‘&lt;/head&gt;\n’ +<br />
                    ‘&lt;body&gt;\n’ + gridContent + ‘\n&lt;/body&gt;\n&lt;/html&gt;’;<br />
                document.write(pageContent);<br />
                document.close();<br />
                newWindow.print();<br />
            });<br />
         });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=‘default’&gt;<br />
    &lt;div id=‘jqxWidget’ style=“font-size: 13px; font-family: Verdana; float: left;”&gt;<br />
        &lt;div id=“jqxgrid”&gt;&lt;/div&gt;<br />
        &lt;div style=‘margin-top: 20px;’&gt;<br />
            &lt;div style=‘float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to Excel” id=‘excelExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to XML” id=‘xmlExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to CSV” id=‘csvExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to TSV” id=‘tsvExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Export to HTML” id=‘htmlExport’ /&gt;<br />
                &lt;br /&gt;&lt;br /&gt;<br />
                &lt;input type=“button” value=“Export to JSON” id=‘jsonExport’ /&gt;<br />
            &lt;/div&gt;<br />
            &lt;div style=‘margin-left: 10px; float: left;’&gt;<br />
                &lt;input type=“button” value=“Print” id=‘print’ /&gt;<br />
            &lt;/div&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>That is all. We have successfully created a wonderful JQX Grid as in the following:</p>
<div id="attachment_8991" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality1.jpg"><img decoding="async" aria-describedby="caption-attachment-8991" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality1.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="528" class="size-full wp-image-8991" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality1.jpg 439w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality1-300x244.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality1-400x325.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-8991" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<div id="attachment_9001" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality2.jpg"><img decoding="async" aria-describedby="caption-attachment-9001" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality2.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="536" class="size-full wp-image-9001" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality2.jpg 433w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality2-300x247.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality2-400x330.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9001" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<div id="attachment_9011" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality3.jpg"><img decoding="async" aria-describedby="caption-attachment-9011" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality3.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="530" class="size-full wp-image-9011" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality3.jpg 438w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality3-300x245.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality3-400x326.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9011" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<p>Now you may think, why are those export buttons outside? It looks different, right? Now we can work on it. In the JQX Grid there is an option called showtoolbar, by setting this to true we can have a toolbar along with the grid. There we can bind all of these buttons if you want. So shall we start?<br />
[js]<br />
showtoolbar: true,<br />
[/js]</p>
<p>Add that line to your JQX grid implementation. Next we need to append the UI elements to the tool bar, right?<br />
[js]<br />
rendertoolbar:function (toolbar) {<br />
                                     var me = this;<br />
                                     var container = $(“&lt;div &gt;&lt;/div&gt;”);<br />
                                     var input = $(‘&lt;div id=”excelExport” style=”background-color: #555555;float: left; font-<br />
                                                    weight: bold;line-height: 28px; min-<br />
                                                    width: 80px;padding: 3px 5px 3px 10px;color: #fff; “&gt;Excel&lt;/div&gt;<br />
                                                    div style=”background-color: #555555;float: left; font-weight: bold;line-<br />
                                                    height: 28px; min-width: 80px;padding: 3px 5px 3px 10px;color: #fff; margin-<br />
                                                    left: 3px;” id=”print” &gt;Print&lt;/div&gt;&lt;/div&gt;’);<br />
                                     toolbar.append(container);<br />
                                     container.append(input);<br />
                                 }<br />
[/js]</p>
<p>Add the preceding function also. 🙂 Now this is how your JQX Grid Implementation must be:<br />
[js]<br />
$(“#jqxgrid”).jqxGrid(<br />
                        {<br />
                            width: 900,<br />
                            source: dataAdapter,<br />
                            filterable: true,<br />
                            sortable: true,<br />
                            pageable: true,<br />
                            autorowheight: true,<br />
                            altrows: true,<br />
                            columnsresize: true,<br />
                            showtoolbar: true,<br />
                            rendertoolbar: function (toolbar) {<br />
                            var me = this;<br />
                            var container = $(“&lt;div &gt;&lt;/div&gt;”);<br />
                            var input = $(‘&lt;div id=”div1″ style=”background-color: #555555;float: left; font-weight: bold;line-<br />
                                          height: 28px; min-width: 80px;padding: 3px 5px 3px 10px;color: #fff; “&gt;Your First Div&lt;/div&gt;<br />
                                          &lt;div style=”background-color: #555555;float: left; font-weight: bold;line-height: 28px; min-<br />
                                          width: 80px;padding: 3px 5px 3px 10px;color: #fff; margin-<br />
                                          left: 3px;” id=”Div2″ &gt;Your Second Div&lt;/div&gt;&lt;/div&gt;’);<br />
                           toolbar.append(container);<br />
                           container.append(input);<br />
                      },<br />
                columns: [<br />
                           { text: ‘Supplier Name’, cellsalign: ‘center’, align: ‘center’, datafield: ‘SupplierName’, width: 110 },<br />
                           { text: ‘Name’, columngroup: ‘ProductDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘ProductName’<br />
                             , width: 120 },<br />
                           { text: ‘Quantity’, columngroup: ‘ProductDetails’, datafield: ‘Quantity’, cellsformat: ‘d’, cellsalign: ‘cente<br />
                             r’, align: ‘center’, width: 80 },<br />
                           { text: ‘Freight’, columngroup: ‘OrderDetails’, datafield: ‘Freight’, cellsformat: ‘d’, cellsalign: ‘center’,<br />
                             align: ‘center’, width: 100 },<br />
                           { text: ‘Order Date’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, cellsformat: ‘d’, da<br />
                             tafield: ‘OrderDate’, width: 100 },<br />
                           { text: ‘Order Address’, columngroup: ‘OrderDetails’, cellsalign: ‘center’, align: ‘center’, datafield: ‘Order<br />
                             Address’, width: 100 },<br />
                           { text: ‘Price’, columngroup: ‘ProductDetails’, datafield: ‘Price’, cellsformat: ‘c2′, align: ‘center’, cellsa<br />
                             lign: ‘center’, width: 70 },<br />
                           { text: ‘Address’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘Address’, width<br />
                             : 120 },<br />
                           { text: ‘City’, columngroup: ‘Location’, cellsalign: ‘center’, align: ‘center’, datafield: ‘City’, width: 80 }<br />
                         ],<br />
           columngroups: [<br />
                           { text: ‘Product Details’, align: ‘center’, name: ‘ProductDetails’ },<br />
                           { text: ‘Order Details’, parentgroup: ‘ProductDetails’, align: ‘center’, name: ‘OrderDetails’ },<br />
                           { text: ‘Location’, align: ‘center’, name: ‘Location’ }<br />
                         ]<br />
         });<br />
[/js]</p>
<p>Now your output looks like the following:</p>
<div id="attachment_9021" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality4.jpg"><img decoding="async" aria-describedby="caption-attachment-9021" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality4.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="522" class="size-full wp-image-9021" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality4.jpg 445w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality4-300x241.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality4-400x321.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9021" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<p>What if you want to share this Grid with your friends? For that we have a jQuery share pluggin, <a href="http://www.jqueryscript.net/social-media/Minimal-jQuery-Plugin-For-Social-Share-Buttons-Sharer.html" target="_blank">Minimal jQuery Plugin For Social Share Buttons – Sharer</a>.</p>
<p><strong>Include the following files from the downloded rar from the preceding link</strong></p>
<li>jquery.sharer.css</li>
<li>jquery.sharer.js</li>
<li>sharer.png</li>
<p>[js]<br />
&lt;link href=“styles/jquery.sharer.css” rel=“stylesheet” type=“text/css” /&gt;<br />
&lt;script src=“scripts/jquery.sharer.js” type=“text/javascript”&gt;&lt;/script&gt;<br />
[/js]</p>
<p><strong>Include the script to your page</strong><br />
[js]<br />
$(“.social-buttons”).sharer();<br />
[/js]</p>
<p><strong>Add a div where you can see the share buttons</strong><br />
[js]<br />
&lt;div class=“social-buttons” style=“position: relative;z-index: 1000;”&gt;&lt;/div&gt;<br />
[/js]</p>
<p>Well, that’s all; you have now done everything. We can now see the page as,</p>
<div id="attachment_9031" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality5.jpg"><img decoding="async" aria-describedby="caption-attachment-9031" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality5.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="478" class="size-full wp-image-9031" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality5.jpg 485w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality5-300x221.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality5-400x294.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9031" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<p>To set the page size add the following line to your grid settings:<br />
[js]<br />
pagesize: 50,<br />
[/js]</p>
<p>To set the custom pagesize options add the following line to your grid settings:<br />
[js]<br />
pagesizeoptions: [‘5′,’10’,’15’,’20’,’30’,’40’,’50’],<br />
[/js]</p>
<p>To allow resizing of the columns add the following line to your grid settings:<br />
[js]<br />
columnsresize: true,<br />
[/js]</p>
<p>To allow column re-ordering options add the following line to your grid settings:</p>
<p>[js]<br />
columnsreorder: true,<br />
[/js]</p>
<p>Be sure that you added the <em>jqxgrid.columnsreorder.js</em> JavaScript file.</p>
<p>To allow an Excel-like filter add the following line to your grid settings:<br />
[js]<br />
filtermode: ‘excel’,<br />
[/js]</p>
<p>Then you will get a filtering option as follows:</p>
<div id="attachment_9041" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality6.jpg"><img decoding="async" aria-describedby="caption-attachment-9041" src="http://sibeeshpassion.com/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality6.jpg" alt="Advanced JQX Grid With All Functionality" width="650" height="407" class="size-full wp-image-9041" srcset="/wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality6.jpg 570w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality6-300x188.jpg 300w, /wp-content/uploads/2014/10/advanced-jqx-grid-with-all-functionality6-400x250.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9041" class="wp-caption-text">Advanced JQX Grid With All Functionality</p></div>
<p>To enable the tooltip add the following line to your grid settings<br />
[js]<br />
enabletooltips: true,<br />
[/js]</p>
<p>To apply themes add the following line to your grid settings<br />
[js]<br />
theme: ‘metro’,<br />
[/js]</p>
<p>Please be noted that you must include the style sheet accordingly, In this case you have to include the following<br />
[html]<br />
&lt;link href=“~/jqwidgets/styles/jqx.metro.css” rel=“stylesheet” /&gt;<br />
[/html]</p>
<p>You can find so many CSS in <em>jqwidgets/styles</em> folder.</p>
<p>To enable auto height add the following line to your grid settings<br />
[js]<br />
autoheight: true,<br />
[/js]</p>
<p>To show the default filter icon always add the following line to your grid settings<br />
[js]<br />
autoshowfiltericon: false,<br />
[/js]</p>
<p>Happy Coding 🙂</p>
<p><strong>History</strong></p>
<p>First Version: 20-Oct-2014<br />
Second Version: 23-Oct-2014</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://www.sibeeshpassion.com/advanced-jqx-grid-with-all-functionality/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
	</channel>
</rss>
