<?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>Bind JSON to Grid &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/bind-json-to-grid/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Tue, 19 Jan 2016 09:00:37 +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>Bind JSON to Grid &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Convert JSON Data Into Data Grid Columns</title>
		<link>https://sibeeshpassion.com/convert-json-data-into-data-grid-columns/</link>
					<comments>https://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://sibeeshpassion.com/convert-json-data-into-data-grid-columns/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bind Json Data to JQWidget JQX Grid</title>
		<link>https://sibeeshpassion.com/bind-json-data-to-jqwidget-jqx-grid/</link>
					<comments>https://sibeeshpassion.com/bind-json-data-to-jqwidget-jqx-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 18 Jun 2015 09:12:56 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Bind JSON to Grid]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[JSON Grid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=5081</guid>

					<description><![CDATA[Introduction Hi All, How are you today? Today we will learn how we can bind a Json data to JQWidget, JQX Grid. I hope you will like it. Downloads Download the source files here: BindJSONToGrid.rar Background If you are new to JQWidget JQX Grid, Please find out here: http://sibeeshpassion.com/category/jqwidgets/ Using the code Here I am using Visual Studio 2012. We will have a txt file in which we will have the JSON data, you can use this file or you can manually load Json data from server side. So let us start First of all we must include the needed [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Hi All, How are you today? Today we will learn how we can bind a Json data to JQWidget, JQX Grid. I hope you will like it.</p>
<p><strong>Downloads</strong></p>
<p>Download the source files here: <a href="http://sibeeshpassion.com/download/BindJSONToGrid.rar" target="_blank">BindJSONToGrid.rar</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>Here I am using Visual Studio 2012. We will have a txt file in which we will have the JSON data, you can use this file or you can manually load Json data from server side.</p>
<p><strong>So let us start</strong></p>
<p>First of all we must include the needed files for the grid.</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>No we can start the grid implementation. For that create a ready function and add the codes as follows.<br />
[js]</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;</p>
<p>[/js]</p>
<p>Now what else we need? Yes, we need to create a div where we can render our grid.</p>
<p>[html]<br />
 &lt;h2&gt;Bind Json Data to JQwidgets JQX grid &#8211; Sibeesh Passion&lt;/h2&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
[/html]</p>
<p>What about our data? We have not seen our data right? </p>
<p>[js]<br />
[{&quot;AreaCode&quot;:&quot;B697-31&quot;,&quot;Revenue&quot;:12747128.190000001},{&quot;AreaCode&quot;:&quot;B697-92&quot;,&quot;Revenue&quot;:7922559.1600000048},{&quot;AreaCode&quot;:&quot;B697-76&quot;,&quot;Revenue&quot;:7541039.540000001},{&quot;AreaCode&quot;:&quot;B697-46&quot;,&quot;Revenue&quot;:7076495.5800000066},{&quot;AreaCode&quot;:&quot;B553-131&quot;,&quot;Revenue&quot;:5738816.5099999979},{&quot;AreaCode&quot;:&quot;B553-193&quot;,&quot;Revenue&quot;:4608556.52},{&quot;AreaCode&quot;:&quot;B697-74&quot;,&quot;Revenue&quot;:3895194.1099999994},{&quot;AreaCode&quot;:&quot;D158-233&quot;,&quot;Revenue&quot;:3572808.989999996},{&quot;AreaCode&quot;:&quot;B697-78&quot;,&quot;Revenue&quot;:3512657.6999999937},{&quot;AreaCode&quot;:&quot;B672-31&quot;,&quot;Revenue&quot;:2955916.9800000032},{&quot;AreaCode&quot;:&quot;B553-46&quot;,&quot;Revenue&quot;:2806813.7100000042}]<br />
[/js]</p>
<p>All set now. So shall we see the grid now?</p>
<p><strong>Output</strong></p>
<p><img decoding="async" src="http://sibeeshpassion.com/content/images/bndjsn1.PNG" alt="" /></p>
<p><strong>Things to remember</strong></p>
<p>Make sure that your  data type is json in source object.</p>
<p>[js]<br />
datatype: &quot;json&quot;<br />
[/js]</p>
<p>Make sure your json is valid</p>
<p><strong>Conclusion</strong></p>
<p>I hope you will like this article. Please share me your valuable thoughts and comments. Your feedback is always welcomed.</p>
<p>Thanks in advance. Happy coding!</p>
<p>Kindest Regards<br />
<a href="https://plus.google.com/+sibeeshkv" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/bind-json-data-to-jqwidget-jqx-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
