<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.infragistics.com/community/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Craig Shoemaker</title><subtitle type="html" /><id>http://www.infragistics.com/community/blogs/craig_shoemaker/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.infragistics.com/community/blogs/craig_shoemaker/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.infragistics.com/community/blogs/craig_shoemaker/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.36.8414">Community Server</generator><updated>2012-05-14T14:41:00Z</updated><entry><title>Mocking Requests and Data for the Ignite UI igGrid</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/03/28/mocking-requests-and-data-for-the-ignite-ui-iggrid.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/03/28/mocking-requests-and-data-for-the-ignite-ui-iggrid.aspx</id><published>2013-03-28T17:47:00Z</published><updated>2013-03-28T17:47:00Z</updated><content type="html">&lt;p&gt;Sometimes when you are working on a new feature of an application the server and client are either in development at different stages or maybe you just want to work out the particulars of a view in isolation from the server. To make this possible there are a few JavaScript libraries that makes it very easy to mock not only data used in the grid, but also Ajax requests to the server.&lt;/p&gt;
&lt;p&gt;The following screenshot is the &lt;a href="http://www.infragistics.com/products/jquery/grid/"&gt;igGrid&lt;/a&gt; filled with random data generated with &lt;a href="http://experiments.mennovanslooten.nl/2010/mockjson/"&gt;mockJSON&lt;/a&gt; and is served to the grid using the client-side &lt;a href="https://github.com/appendto/jquery-mockjax#documentation"&gt;Mockjax&lt;/a&gt; library.&lt;/p&gt;
&lt;p&gt;&lt;img title="Mocking requests and data for the Ignite UI igGrid" src="http://users.infragistics.com/craigs/images/blog/iggrid-mock-data.png" width="650" height="420" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;When you use an approach like this you are easily able to separate out all mocking behavior so when it&amp;rsquo;s time to work with the real server you can simply remove the reference to the mocks and then the scripts and grid will work just like normal. The code for the grid remains unchanged whether or not you are using mocked requests and data or not.&lt;/p&gt;
&lt;h2&gt;Code Download&lt;/h2&gt;
&lt;p&gt;If you would like to take a look at the source files use for this example, &lt;a href="http://users.infragistics.com/craigs/code/iggrid-mock-data.zip"&gt;please download them here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Mocking Requests and Data&lt;/h2&gt;
&lt;p&gt;In order to truly isolate the client from the server you need to first intercept on the client the requests made to the server. Once the requests are handled locally, then you can construct a mocked response to the page and return it back to the grid.&lt;/p&gt;
&lt;p&gt;Mocking requests is handled by the Mockjax library. What&amp;rsquo;s nice about this library is that as you define routes in the configuration script, any matching requests to the server are intercepted by Mockjax on the client. Even while the client has control of the request, its able to return a response to the page which identical to what the server would provide to the client.&lt;/p&gt;
&lt;p&gt;Mocking data is handled by the mockJSON library which uses a template to generate a series of randomized data to send in the response as provided by the Mockjax library.&lt;/p&gt;
&lt;p&gt;The following is a sample of a mockJSON template to generate some very simple employee objects:&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;var data = $.mockJSON.generateFromTemplate({
    &amp;quot;employees|1-5&amp;quot;: [{
        &amp;quot;id|+1&amp;quot;: 1,
        &amp;quot;firstName&amp;quot;: &amp;quot;@MALE_FIRST_NAME&amp;quot;,
        &amp;quot;lastName&amp;quot;: &amp;quot;@LAST_NAME&amp;quot;
    }]
});&lt;/pre&gt;
&lt;p&gt;You&amp;rsquo;ll notice some additional characters in what seems like a normal object literal definition. The &lt;code&gt;|&lt;/code&gt; character is a delimiter to tell mockJSON there are some commands included in the template definition. The value that follows directly after the root element (&lt;code&gt;employees&lt;/code&gt;) and delimiter is a setting that tells mockJSON how many instances of the mock object to create. The numbers represent a range of random numbers which determine how many objects to create.&lt;/p&gt;
&lt;p&gt;The next command in the template is found just after the &lt;code&gt;id&lt;/code&gt; label. The &lt;code&gt;+1&lt;/code&gt; command tells mockJSON to increment the value by 1 each time a new object is created. This allows each object to have a unique id.&lt;/p&gt;
&lt;p&gt;The template uses keywords (words preceded by an@symbol) to act as placeholders where random data is injected into generated JSON objects. There are many built-in keywords and you can even create your own keywords with custom values available for data generation.&lt;/p&gt;
&lt;h2&gt;Loading Scripts&lt;/h2&gt;
&lt;p&gt;To get started, the script loader is configured with known paths to the required JavaScript and CSS files and brings in all the igGrid features used in this example. The comment inside the &lt;code&gt;ready&lt;/code&gt; event handler is a placeholder for the code in the next section which is concerned with setting up the grid on the page.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;$.ig.loader({
    scriptPath: &amp;#39;http://localhost/ig_ui/js/&amp;#39;,
    cssPath: &amp;#39;http://localhost/ig_ui/css/&amp;#39;,
    resources: &amp;quot;igGrid,igGrid.Filtering,igGrid.GroupBy,igGrid.Paging,igGrid.Sorting&amp;quot;,
    ready: function () {

       // setup grid here...

    }
});&lt;/pre&gt;
&lt;h2&gt;Loading the Grid&lt;/h2&gt;
&lt;p&gt;Now that the page is ready and the scripts are loaded, you can setup the grid on the page. The data for the grid is made available after a JSON response is recognized from the server. Then the columns and features are setup.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;$.getJSON(&amp;#39;api/employees&amp;#39;, function (data) {

    var grid = $(&amp;quot;#grid&amp;quot;).igGrid({

        autoGenerateColumns: false,
        defaultColumnWidth: &amp;quot;180px&amp;quot;,
        dataSource: data,

        columns: [
            { headerText: &amp;quot;ID&amp;quot;, key: &amp;quot;id&amp;quot;, dataType: &amp;quot;number&amp;quot;, width: &amp;quot;80px&amp;quot; },
            { headerText: &amp;quot;First&amp;quot;, key: &amp;quot;firstName&amp;quot; },
            { headerText: &amp;quot;Last&amp;quot;, key: &amp;quot;lastName&amp;quot; },
            { headerText: &amp;quot;Email&amp;quot;, key: &amp;quot;email&amp;quot; },
            { headerText: &amp;quot;Title&amp;quot;, key: &amp;quot;title&amp;quot; },
            { headerText: &amp;quot;Active&amp;quot;, key: &amp;quot;active&amp;quot;, dataType: &amp;quot;bool&amp;quot;, format: &amp;quot;checkbox&amp;quot; },
            { headerText: &amp;quot;Workshop Day&amp;quot;, key: &amp;quot;workshopDay&amp;quot; }
        ],

        features: [
            { name: &amp;quot;Filtering&amp;quot;, columnSettings: [{ columnKey: &amp;quot;id&amp;quot;, allowFiltering: false }], mode: &amp;quot;simple&amp;quot; },
            { name: &amp;quot;GroupBy&amp;quot; },
            { name: &amp;quot;Paging&amp;quot;, pageSize: 20, pageSizeList: [5, 8, 10, 20, 50] },
            { name: &amp;quot;Sorting&amp;quot; }
        ]
    });
});&lt;/pre&gt;
&lt;p&gt;This is all the code the page needs to operate. Notice how there is zero mention of mocks in the loader or grid code. There are no flags to alternate data source locations and there is no conditional logic required for the page or the control to differentiate between a &amp;ldquo;real&amp;rdquo; scenario and a &amp;ldquo;fake&amp;rdquo; scenario. This is the power of working with mocking frameworks &amp;ndash; interaction with the mocks is completely abstracted away from the page.&lt;/p&gt;
&lt;h2&gt;Data Schema&lt;/h2&gt;
&lt;p&gt;Before diving into the details of the data that is generated for the page, first take a look at a single sample data item that is close to what is generated for the grid.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;{
    &amp;quot;id&amp;quot; : 1,
    &amp;quot;firstName&amp;quot; : &amp;quot;Henry&amp;quot;,
    &amp;quot;lastName&amp;quot; : &amp;quot;Smith&amp;quot;,
    &amp;quot;title&amp;quot; : &amp;quot;Customer Service Rep.&amp;quot;,
    &amp;quot;email&amp;quot; : &amp;quot;smith@company.com&amp;quot;,
    &amp;quot;active&amp;quot; : true,
    &amp;quot;workshopDay&amp;quot; : &amp;quot;Wednesday&amp;quot;
}&lt;/pre&gt;
&lt;p&gt;The data generated represents typical information commonly found in an employee database. The next section details how to generate a series of data items structured just like this example.&lt;/p&gt;
&lt;h2&gt;Adding Mock Support&lt;/h2&gt;
&lt;p&gt;In order for the page to use the mocking libraries all you need to do is create a new file and add the mock definitions to the file and reference it from the web page. In this example the additional script reference is:&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;

&lt;/pre&gt;
&lt;p&gt;The contents of &lt;code&gt;mock.data.js&lt;/code&gt; begin with a self-executing anonymous function.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;(function () {

    // add mocks here

})();&lt;/pre&gt;
&lt;p&gt;The first items added inside the anonymous function are some custom keywords. The first is the &lt;code&gt;&amp;amp;WEEKDAY&lt;/code&gt; keyword which is an array of each week day.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;    $.mockJSON.data.WEEKDAY = [
        &amp;#39;Monday&amp;#39;,
        &amp;#39;Tuesday&amp;#39;,
        &amp;#39;Wednesday&amp;#39;,
        &amp;#39;Thursday&amp;#39;,
        &amp;#39;Friday&amp;#39;
    ];&lt;/pre&gt;
&lt;p&gt;The next keyword is a list of job titles.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;    $.mockJSON.data.TITLE = [
        &amp;#39;Director of Product Engineering&amp;#39;,
        &amp;#39;Vice President&amp;#39;,
        &amp;#39;Senior Accountant&amp;#39;,
        &amp;#39;Accountant&amp;#39;,
        &amp;#39;Customer Service Rep.&amp;#39;,
        &amp;#39;Sales&amp;#39;,
        &amp;#39;Support Engineer&amp;#39;,
        &amp;#39;Greeter&amp;#39;,
        &amp;#39;Division Manager&amp;#39;
    ];&lt;/pre&gt;
&lt;p&gt;Then, I added a list of the values for the active flag.&lt;/p&gt;
&lt;p&gt;Now, you may be inclined, as I was, to attempt to add some logic into the template. Be forewarned this will not work as you expect. The template is indeed a template and is extracted from the method once and then used to generate each instance of a mock object. In the end, the template is a string and cannot include executing code. (Initially I tried to add a conditional statement to return a random Boolean value, but in the end formatting this value as a keyword is the approach that accomplished what I was trying to do.)&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;    $.mockJSON.data.ACTIVE = [
        true,
        false
    ];&lt;/pre&gt;
&lt;p&gt;The following code listing defines a route that is intercepted by Mockjax. When a request to &lt;code&gt;api/employees&lt;/code&gt; is made a response is generated on the client and returns as &lt;code&gt;text/json&lt;/code&gt; response back to the caller.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;    $.mockjax({
        url: &amp;#39;api/employees&amp;#39;,
        contentType: &amp;#39;text/json&amp;#39;,
        response: function () {
            var employees = generateEmployees();
            this.responseText = employees;
        }
    });&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;generateEmployees&lt;/code&gt; function uses mockJSON to create exactly 54 customer objects. (When you don&amp;rsquo;t provide a range mockJSON will use the amount you pass in.)&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;    var generateEmployees = function () {
        var data = $.mockJSON.generateFromTemplate({
            &amp;quot;employees|54-54&amp;quot;: [{
                &amp;quot;id|+1&amp;quot;: 1,
                &amp;quot;firstName&amp;quot;: &amp;quot;@MALE_FIRST_NAME&amp;quot;,
                &amp;quot;lastName&amp;quot;: &amp;quot;@LAST_NAME&amp;quot;,
                &amp;quot;title&amp;quot;: &amp;quot;@TITLE&amp;quot;,
                &amp;quot;email&amp;quot;: &amp;quot;@EMAIL&amp;quot;,
                &amp;quot;active&amp;quot;: &amp;quot;@ACTIVE&amp;quot;,
                &amp;quot;workshopDay&amp;quot; : &amp;quot;@WEEKDAY&amp;quot;
            }]
        });

        return data.employees;
    }&lt;/pre&gt;
&lt;p&gt;Lastly, the template uses both custom and built-in keywords to provide random data into the objects. The &lt;code&gt;@TITLE&lt;/code&gt;, &lt;code&gt;@WEEKDAY&lt;/code&gt; and &lt;code&gt;@ACTIVE&lt;/code&gt; are all custom keywords and the rest are provided by mockJSON.&lt;/p&gt;
&lt;h2&gt;Full Mocking Script&lt;/h2&gt;
&lt;p&gt;Just so you can see it working all together in context, here is the full mocking script.&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;(function () {

    $.mockJSON.data.WEEKDAY = [
        &amp;#39;Monday&amp;#39;,
        &amp;#39;Tuesday&amp;#39;,
        &amp;#39;Wednesday&amp;#39;,
        &amp;#39;Thursday&amp;#39;,
        &amp;#39;Friday&amp;#39;
    ];

    $.mockJSON.data.TITLE = [
        &amp;#39;Director of Product Engineering&amp;#39;,
        &amp;#39;Vice President&amp;#39;,
        &amp;#39;Senior Accountant&amp;#39;,
        &amp;#39;Accountant&amp;#39;,
        &amp;#39;Customer Service Rep.&amp;#39;,
        &amp;#39;Sales&amp;#39;,
        &amp;#39;Support Engineer&amp;#39;,
        &amp;#39;Greeter&amp;#39;,
        &amp;#39;Division Manager&amp;#39;
    ];

    $.mockJSON.data.ACTIVE = [
        true,
        false
    ];

    // mock requests to employees
    $.mockjax({
        url: &amp;#39;api/employees&amp;#39;,
        contentType: &amp;#39;text/json&amp;#39;,
        response: function () {
            var employees = generateEmployees();
            this.responseText = employees;
        }
    });

    var generateEmployees = function () {
        var data = $.mockJSON.generateFromTemplate({
            &amp;quot;employees|54-54&amp;quot;: [{
                &amp;quot;id|+1&amp;quot;: 1,
                &amp;quot;firstName&amp;quot;: &amp;quot;@MALE_FIRST_NAME&amp;quot;,
                &amp;quot;lastName&amp;quot;: &amp;quot;@LAST_NAME&amp;quot;,
                &amp;quot;title&amp;quot;: &amp;quot;@TITLE&amp;quot;,
                &amp;quot;email&amp;quot;: &amp;quot;@EMAIL&amp;quot;,
                &amp;quot;active&amp;quot;: &amp;quot;@ACTIVE&amp;quot;,
                &amp;quot;workshopDay&amp;quot; : &amp;quot;@WEEKDAY&amp;quot;
            }]
        });

        return data.employees;
    }
})();&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Working with mocking libraries gives you ultimate flexibility in being able to test and develop your views independent of the server. When the mock data definitions are present, the page uses mocked data and requests. When references to the mocks are removed, the page works against the server just like normal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=398315" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author></entry><entry><title>Remote Load-on-Demand with the Ignite UI igTree</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/03/27/remote-load-on-demand-with-the-ignite-ui-igtree.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/03/27/remote-load-on-demand-with-the-ignite-ui-igtree.aspx</id><published>2013-03-27T13:25:00Z</published><updated>2013-03-27T13:25:00Z</updated><content type="html">&lt;p&gt;The Ignite UI igTree is a powerful client-side jQuery UI widget which has a ton of great features baked right into the control. One of the most valuable features of any tree is its ability to support load-on-demand from a remote server. On a recent project I used the tree to read through a series of XML files which represented many megabytes of data &amp;ndash; a remote load-on-demand configuration was must in this situation.&lt;/p&gt;
&lt;p&gt;In this example I strip away all the complexities of the file system and server and just isolate the tree to demonstrate how to configure the control for a remote load-on-demand scenario. Along the way I&amp;rsquo;ll also demonstrate how to use a few very handy JavaScript and JSON mocking libraries to help isolate work with the tree.&lt;/p&gt;
&lt;p&gt;The following image shows how the tree works configured for load-on-demand where each node click initiates a request for its children, the node is auto-expanded and selected and the node&amp;rsquo;s URL data member is shown in the box above the tree.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The URLs used in this example are generated lorem ipsum text. The particulars of how the sample data is generated is detaild in the section &lt;b&gt;Mocking Ajax Requests and Data&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://users.infragistics.com/craigs/images/blog/igtree-remote-load-on-demand.gif" width="365" height="482" alt="igTree working in remote load-on-demand context." /&gt;&lt;/p&gt;
&lt;h2&gt;Code Download&lt;/h2&gt;
&lt;p&gt;If you would like to work directly with the source files used in this example, &lt;a href="http://users.infragistics.com/craigs/code/igtree-remote-load-on-demand.zip"&gt;you can download them here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;The first step is to create a self-executing anonymous function which then sets up the Ignite UI loader. Inside the function, the loader is configured to have known locations for the dependent JavaScript and CSS files. As represented by the comments, when the &lt;code&gt;ready&lt;/code&gt; event fires the code to configure the tree is run. The setup for the tree is detailed in the next section.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;(function () {

    $.ig.loader({
        scriptPath: &amp;#39;http://localhost/js/&amp;#39;,
        cssPath: &amp;#39;http://localhost/css/&amp;#39;,
        resources: &amp;#39;igTree&amp;#39;,
        ready: function () {

	   // add rest of code here

        }
    });
})();&lt;/pre&gt;
&lt;h2&gt;Setting Up the Tree&lt;/h2&gt;
&lt;p&gt;Now that the page is ready and all the scripts and styles are loaded, the next step is to set up the tree control. The tree is instantiated by selecting the root element via the &lt;code&gt;#toc&lt;/code&gt; selector and calling the &lt;code&gt;igTree&lt;/code&gt; function. Next, there are a handful of options required to set the tree in a load-on-demand state. The &lt;code&gt;singleBranchExpanded&lt;/code&gt; option tells the tree to only allow one branch of the tree to remain expanded at one time (this feature isn&amp;rsquo;t load-on-demand specific, but does make the tree easier to use for the user). The &lt;code&gt;dataSourceUrl&lt;/code&gt; option tells the tree which URL to use to request data items in the tree. The value of &lt;code&gt;remoteUrl&lt;/code&gt; the &lt;code&gt;dataSourceType&lt;/code&gt; option designates to the tree that data is coming from a remote source. The &lt;code&gt;loadOnDemand&lt;/code&gt; option tells the tree that child items in the tree will only be bound to the tree once a request for the child items is made.&lt;/p&gt;
&lt;p&gt;The comments represent a place where the event handlers will go which allow the grid to load data when a node is expanded. Finally, incoming data is bound to the tree based on the mappings defined by the &lt;code&gt;bindings&lt;/code&gt; object literal found at the end of the control definition.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;var tree = $(&amp;#39;#toc&amp;#39;).igTree({
    singleBranchExpand: true,
    dataSourceUrl: &amp;#39;/api/items&amp;#39;,
    dataSourceType: &amp;#39;remoteUrl&amp;#39;,
    loadOnDemand: true,

    // Add event handlers here

    bindings: {
        textKey: &amp;#39;title&amp;#39;,
        navigateUrlKey: &amp;#39;url&amp;#39;,
        childDataProperty: &amp;#39;items&amp;#39;,
        valueKey: &amp;#39;url&amp;#39;
    }
});&lt;/pre&gt;
&lt;h2&gt;Event Handlers&lt;/h2&gt;
&lt;p&gt;The previous code configured the tree for load-on-demand, but the implementation found in the event handlers is what gives the tree the desired behavior.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;nodePopulating&lt;/code&gt; event fires when the tree is attempting to load the child nodes of a selected node. The implementation of this event handler sets the &lt;code&gt;dataSourceUrl&lt;/code&gt; to a location specific for the selected node each time a new node is being populated. (When the tree is configured for load-on-demand, nodes are only populated when a node is being expanded.)&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    nodePopulating: function (event, ui) {
        tree.igTree(&amp;#39;option&amp;#39;, &amp;#39;dataSourceUrl&amp;#39;, &amp;#39;/api/items?id=&amp;#39; + ui.data.id);
        return true;
    }&lt;/pre&gt;
&lt;p&gt;The next event is the &lt;code&gt;nodeClick&lt;/code&gt; event. The &lt;code&gt;nodeClick&lt;/code&gt; event is handled in order to add behavior to automatically expand and select the clicked node. The first line, &lt;code&gt;e.preventDefault()&lt;/code&gt;, is needed in order to stop the browser from attempting to navigate away from the page. Next, the tree is given commands to toggle the clicked node (where it will open if it&amp;rsquo;s closed, and vice versa) and then select it.&lt;/p&gt;
&lt;p&gt;The call to the &lt;code&gt;clicked&lt;/code&gt; function simply takes the current &lt;code&gt;ui.node.data.url&lt;/code&gt; value and prints it on the screen. The last operation is to return &lt;code&gt;false&lt;/code&gt;, again to make sure that the control stops any further processing.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    nodeClick: function (e, ui) {
        e.preventDefault();
        tree.igTree(&amp;#39;toggle&amp;#39;, ui.node.element);
        tree.igTree(&amp;#39;select&amp;#39;, ui.node.element);
        clicked(ui.node.data.url);
        return false;
    }&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Since the settings are being passed to the tree as an object literal, the event functions must be followed by a comma after the closing brace to the function. The full code listing at the bottom of this post shows each of the event handlers in context of the object literal.&lt;/p&gt;
&lt;p&gt;Once the tree is set up with these options and the event handlers are implemented, the tree is fully configured for remote load-on-demand.&lt;/p&gt;
&lt;h2&gt;Mocking Ajax Requests and Data&lt;/h2&gt;
&lt;p&gt;While the tree is in working order, providing data to the tree can get involved if you need to set up a server side counterpart to handle serving data to the client. A technique I used in this example was to mock the JSON data that is provided to the tree. This is made possible by leveraging two JavaScript libraries. The first library is &lt;a href="https://github.com/appendto/jquery-mockjax#readme"&gt;Mockjax&lt;/a&gt; which intercepts Ajax requests made by the tree and allows them to be fulfilled locally - all the while returning an identical response a server would send back to the tree.&lt;/p&gt;
&lt;p&gt;The second library I used was &lt;a href="http://experiments.mennovanslooten.nl/2010/mockjson/"&gt;mockJSON&lt;/a&gt; which is an engine responsible for generating mock data in JSON format based on some rules you provide. The nice thing that once the mocking is setup, all the mocking logic is easily separated from the standard executing code. In this example, moving all the mocking code into a separate file is trivial. When you are ready to remove mocked requests and data, all you have to do is simply remove the reference to the file and the tree will then go back to contacting the server just like normal using the URLs configured in the &lt;code&gt;dataSourceUrl&lt;/code&gt; option.&lt;/p&gt;
&lt;h2&gt;Full Code Listing: Load-on-Demand Demo (index.html)&lt;/h2&gt;
&lt;pre class="csharpcode"&gt;(function () {

    $.ig.loader({
        scriptPath: &amp;#39;http://localhost/js/&amp;#39;,
        cssPath: &amp;#39;http://localhost/css/&amp;#39;,
        resources: &amp;#39;igTree&amp;#39;,
        ready: function () {

            var tree = $(&amp;#39;#toc&amp;#39;).igTree({
                singleBranchExpand: true,
                dataSourceUrl: &amp;#39;/api/items&amp;#39;,
                dataSourceType: &amp;#39;remoteUrl&amp;#39;,
                loadOnDemand: true,

                nodePopulating: function (event, ui) {
                    tree.igTree(&amp;#39;option&amp;#39;, &amp;#39;dataSourceUrl&amp;#39;, &amp;#39;/api/items?id=&amp;#39; + ui.data.id);
                    return true;
                },

                nodeClick: function (e, ui) {
                    e.preventDefault();
                    tree.igTree(&amp;#39;toggle&amp;#39;, ui.node.element);
                    tree.igTree(&amp;#39;select&amp;#39;, ui.node.element);
                    clicked(ui.node.data.url);
                    return false;
                },

                bindings: {
                    textKey: &amp;#39;title&amp;#39;,
                    navigateUrlKey: &amp;#39;url&amp;#39;,
                    childDataProperty: &amp;#39;items&amp;#39;,
                    valueKey: &amp;#39;url&amp;#39;
                }
            });

            var clicked = function (msg) {
                $(&amp;quot;#result&amp;quot;).text(msg.toLowerCase());
            }
        }
    });
})();&lt;/pre&gt;
&lt;h2&gt;Full Code Listing: Mocking Requests and Data (mock.data.js)&lt;/h2&gt;
&lt;pre class="csharpcode"&gt;(function () {

    // mock requests to items
    $.mockjax({
        url: &amp;#39;/api/items&amp;#39;,
        contentType: &amp;#39;text/json&amp;#39;,
        response: function () {
            this.responseText = generateResponse(true);
        }
    });

    // add wildcard mock to capture requests with query string values
    $.mockjax({
        url: &amp;#39;/api/items?*&amp;#39;,
        contentType: &amp;#39;text/json&amp;#39;,
        response: function () {
            // randomizes whether or not the response has child elements
            var hasChildren = parseInt((Math.random() * 10), 10) % 2;

            this.responseText = generateResponse(hasChildren);
        }
    });

    var generateResponse = function (includeItems) {
        var data = $.mockJSON.generateFromTemplate({
            &amp;quot;items|5-5&amp;quot;: [{
                &amp;quot;id|+1&amp;quot;: 1,
                &amp;quot;title&amp;quot;: &amp;quot;Item&amp;quot;,
                &amp;quot;url&amp;quot;: &amp;quot;http://@LOREM.com&amp;quot;,
                &amp;quot;items&amp;quot;: includeItems ? [] : null
            }]
        });
        return data.items;
    }
})();&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=398078" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author></entry><entry><title>9 Interactive Features of the Ignite UI igGrid</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/03/20/9-interactive-features-of-the-ignite-ui-iggrid.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/03/20/9-interactive-features-of-the-ignite-ui-iggrid.aspx</id><published>2013-03-20T16:00:00Z</published><updated>2013-03-20T16:00:00Z</updated><content type="html">&lt;p&gt;Thanks to all who attended my recent session on 9 Interactive Features of the &lt;a href="http://igniteui.com" target="_blank"&gt;Ignite UI&lt;/a&gt; igGrid. There&amp;rsquo;s a lot packed into the grid and features highlighted in the webinar just scratch the surface on what the grid can do!&lt;/p&gt;
&lt;h2&gt;Demos Download&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re interested in working through the samples I used during the demo, &lt;a href="http://users.infragistics.com/craigs/code/9-interactive-features-iggrid.zip" target="_blank"&gt;you can download the code here&lt;/a&gt;. Please note that you&amp;rsquo;ll need to setup a virtual directory named &lt;strong&gt;&lt;em&gt;ig_ui&lt;/em&gt;&lt;/strong&gt; to host the &lt;strong&gt;&lt;em&gt;js&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;css&lt;/em&gt;&lt;/strong&gt; folder which have all the Ignite UI files in them.&lt;/p&gt;
&lt;h2&gt;What about the Grid?&lt;/h2&gt;
&lt;p&gt;There are three ways you can get access to the grid to run the samples:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use your existing licensed copy of Ignite UI&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads" target="_blank"&gt;Download a trial of Ignite UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.infragistics.com/IgntieUIGrid-Download/" target="_blank"&gt;Get igGrid for free!&lt;/a&gt; (this offer may not always be available)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once you download the bits and setup the files in your virtual directory, the demos should work unaltered on your machine. The good news is that you can run them by just opening the HTML files from the file system or by running them through a web server.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=397261" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author></entry><entry><title>Get Started Learning Ignite UI Today!</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/03/06/get-started-learning-ignite-ui-today.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/03/06/get-started-learning-ignite-ui-today.aspx</id><published>2013-03-06T23:44:00Z</published><updated>2013-03-06T23:44:00Z</updated><content type="html">&lt;p&gt;Anytime you approach a new library or set of controls sometimes it&amp;rsquo;s nice to get a helping hand. In an effort to make it drop-dead simple for you to learn how to get started with Ignite UI, I am announcing the release of &lt;em&gt;Fundamentals of Ignite UI&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://users.infragistics.com/craigs/images/blog/fundamentals-of-ignite-ui-craig-shoemaker.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;This video series will acquaint you with Ignite UI from some of the high level architectural constructs down to the details a control&amp;rsquo;s API. The first batch of videos in the series includes 15 videos which introduce Ignite UI as a whole and then moves into working with the particulars of the igGrid control.&lt;/p&gt;
&lt;h2&gt;&lt;a href="http://www.youtube.com/playlist?list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;feature=view_all" target="_blank"&gt;Ignite UI Introduction&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=rN4rV09hFcA&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=1" target="_blank"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=DQmQSNYRO5A&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=2" target="_blank"&gt;Coding Approaches and Server Support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=aH3KNVsGWjk&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=3" target="_blank"&gt;Browser &amp;amp; Environment Support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=ONQk4UILoh4&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=4" target="_blank"&gt;Licensing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=FRn8iT55AAQ&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=5" target="_blank"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=HqzGrufVrQc&amp;amp;list=PLZ4rRHIJepBt98obKpM337uRgGz5szMGc&amp;amp;index=6" target="_blank"&gt;Installing &amp;amp; Exploring Ignite UI on Your Machine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a href="http://www.youtube.com/playlist?list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;feature=view_all" target="_blank"&gt;igGrid Introduction&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=_NnikveqpxY&amp;amp;list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;index=1" target="_blank"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=O4Kh5nVEGgg&amp;amp;list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;index=2" target="_blank"&gt;Features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=xj-nzkvZOso&amp;amp;list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;index=3" target="_blank"&gt;Architectural Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=-IgQUKarnGo&amp;amp;list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;index=4" target="_blank"&gt;The Basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=k1N3EmftZXE&amp;amp;list=PLZ4rRHIJepBs4_y7YzmEqDsDuVqH7HPqm&amp;amp;index=5" target="_blank"&gt;Basic Options&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a href="http://www.youtube.com/playlist?list=PLZ4rRHIJepBulHL6MBMAZaG4WyQU8FN91&amp;amp;feature=view_all" target="_blank"&gt;igGrid Interactive Features&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=yihsqj7DJjE&amp;amp;list=PLZ4rRHIJepBulHL6MBMAZaG4WyQU8FN91&amp;amp;index=1" target="_blank"&gt;Filtering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=YxHSl0u0zY0&amp;amp;list=PLZ4rRHIJepBulHL6MBMAZaG4WyQU8FN91&amp;amp;index=2" target="_blank"&gt;Sorting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=0AKiMjNsYBE&amp;amp;list=PLZ4rRHIJepBulHL6MBMAZaG4WyQU8FN91&amp;amp;index=3" target="_blank"&gt;Selection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=pPyOhH7QiSE&amp;amp;list=PLZ4rRHIJepBulHL6MBMAZaG4WyQU8FN91&amp;amp;index=4" target="_blank"&gt;Paging&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I am splitting up the total of the grids features into interactive, customizable and editable features. This batch just gets you warmed up to the igGrid and then reviews the interactive features. Later customization features will include features like column hiding, merged cells, client templates, column summaries and the like. The last section will take you through the features which support CRUD operations in the grid.&lt;/p&gt;
&lt;p&gt;The long-term goal is to go through as many controls as possible, so there&amp;rsquo;s a lot of content ahead!&lt;/p&gt;
&lt;p&gt;Please let me know what you think of the videos and feel free to suggest what you might like to see covered in an upcoming video.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=395431" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="Ignite UI" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Ignite+UI/default.aspx" /></entry><entry><title>Avoid this Obscure Error when Using the igGrid Control by Selecting the Right Root Element</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/02/04/avoid-this-obscure-error-when-using-the-iggrid-control-by-selecting-the-right-root-element.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/02/04/avoid-this-obscure-error-when-using-the-iggrid-control-by-selecting-the-right-root-element.aspx</id><published>2013-02-04T21:32:00Z</published><updated>2013-02-04T21:32:00Z</updated><content type="html">&lt;p&gt;Instantiating the igGrid control is straight-forward; you can simply create the control with a call similar to &lt;code&gt;$(&amp;quot;#grid&amp;quot;).igGrid()&lt;/code&gt; and pass in grid options depending on your requirements. While it&amp;rsquo;s easy to construct a new grid this way, it&amp;rsquo;s also easy to overlook a small nuance which can have a significant impact on how you work with the control. In the end, the HTML element that is selected by the &lt;code&gt;#grid&lt;/code&gt; selector makes a big difference on how the control is constructed in markup and how easy it is to work against the grid&amp;rsquo;s API.&lt;/p&gt;
&lt;p&gt;&lt;img alt="What&amp;#39;s at the root of your igGrid - TABLE or DIV?" src="http://users.infragistics.com/craigs/images/blog/iggrid-root-table-or-div.png" width="300" height="300" /&gt;&lt;/p&gt;
&lt;h2&gt;TL;DR&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use TABLEs as the root elements for the igGrid and igHierarchicalGrid&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Choosing the Right Root Element&lt;/h2&gt;
&lt;p&gt;There is a subtle difference between the following markup listings when you are working with the igGrid:&lt;/p&gt;
&lt;p&gt;&amp;lt;div id=&amp;quot;grid&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&amp;lt;table id=&amp;quot;grid&amp;quot;&amp;gt;&amp;lt;/table&amp;gt;&lt;/p&gt;
&lt;p&gt;The DIV element is often used as a &amp;ldquo;catch all&amp;rdquo; container for many Ignite UI controls where the generated markup is injected into the DIV and all interaction usually works as expected. The grid controls are a bit different in that they inherently HTML tables, so using a HTML TABLE element as the control&amp;rsquo;s root is the most appropriate choice.&lt;/p&gt;
&lt;h2&gt;Anatomy of the Grid Control&lt;/h2&gt;
&lt;p&gt;When a new instance of the igGrid control is created on a page the root element is wrapped by a container DIV element. This wrapping DIV element is necessary in order to act as a container for the supporting UI elements associated with the grid when different features are enabled in the grid. For instance, when you enable paging, the paging UI elements are rendered in the DIV which contains the TABLE for the grid. The same is true for group by, multi-column headers and any other additional UI elements required by the grid.&lt;/p&gt;
&lt;h2&gt;Effects of Differing Roots&lt;/h2&gt;
&lt;p&gt;To better illustrate the difference between using a DIV as the root element as opposed to a TABLE element, take a look at the following images which depict the markup generated inside a DIV vs. a TABLE element.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Markup generated by a DIV element used as a root to the igGrid control." src="http://users.infragistics.com/craigs/images/blog/iggrid-div-as-root-element.png" width="514" height="484" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Figure 1: igGrid Markup with DIV element as Root Element&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Figure 1&lt;/b&gt; is an excerpt of the markup generated by a grid where the root element is a DIV. In order to generate all the required markup for the control, the widget creates the grid container and TABLE element as respective children of the root DIV element. This can propose a problem if you attempt to access features from the grid.&lt;/p&gt;
&lt;p&gt;For instance, if you attempt to sort the grid with a call to the &lt;em&gt;sortColumn&lt;/em&gt; method such as:&lt;/p&gt;
&lt;pre&gt;$(&amp;quot;#grid&amp;quot;).igGridSorting(&amp;#39;sortColumn&amp;#39;, 1, &amp;#39;ascending&amp;#39;);&lt;/pre&gt;
&lt;p&gt;You will encounter an error like:&lt;/p&gt;
&lt;blockquote&gt;Uncaught TypeError: Cannot read property &amp;#39;currentSortDirection&amp;#39; of undefined&lt;/blockquote&gt;
&lt;p&gt;Now, this is not an error in the control, but rather the object with which was selected as #grid is pointing to a DIV and not the expected TABLE element which produces the error. The resolution is to use a TABLE element as the root of the control.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Markup generated by a TABLE element used as a root to the igGrid control." src="http://users.infragistics.com/craigs/images/blog/iggrid-table-as-root-element.png" width="514" height="484" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Figure 2: igGrid Markup with TABLE Element as Root&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Figure 2&lt;/b&gt; shows how the markup is generated when with a TABLE root element. Notice that the grid is instantiated as a TABLE element with the ID of &lt;em&gt;grid&lt;/em&gt; and it is wrapped with a container DIV element. Now each time the object that is selected against &lt;em&gt;#grid&lt;/em&gt; references the table element, which is the grid itself, rather than a container element.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads" target="_blank"&gt;&lt;img alt="Try Ignite UI today!" src="http://users.infragistics.com/ignite/IgniteUI_Banner_300x250_a2.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=391061" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="Grid" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Grid/default.aspx" /><category term="Ignite UI" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Ignite+UI/default.aspx" /></entry><entry><title>Avoid Errors When Defining Resources with the Ignite UI Loader</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2013/01/21/avoid-errors-when-defining-resources-with-the-ignite-ui-loader.aspx" /><id>/community/blogs/craig_shoemaker/archive/2013/01/21/avoid-errors-when-defining-resources-with-the-ignite-ui-loader.aspx</id><published>2013-01-21T21:58:00Z</published><updated>2013-01-21T21:58:00Z</updated><content type="html">&lt;p&gt;When defining resources in the &lt;i&gt;$.ig.loader&lt;/i&gt; options, you have the option to explicitly load all the scripts associated with the control itself, load a selection of its features and even a load using a wild card option. When you are loading in explicit features the format of the &lt;i&gt;resources&lt;/i&gt; string is very important &amp;ndash; the list is comma delimited and &lt;b&gt;spaces are not allowed&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Therefore, when you are loading scripts&amp;hellip;&lt;/p&gt;
&lt;h2&gt;Don&amp;rsquo;t Do This&lt;/h2&gt;
&lt;pre&gt;$.ig.loader({
    scriptPath: &amp;quot;http://localhost/ig_ui/js/&amp;quot;,
    cssPath: &amp;quot;http://localhost/ig_ui/css/&amp;quot;,
    resources: &amp;quot;igGrid, igGrid.Paging&amp;quot;
});&lt;/pre&gt;
&lt;p&gt;Notice how there is a space after the comma where the second resource is loaded. When you try to run this page you&amp;rsquo;ll get an error that says:&lt;/p&gt;
&lt;blockquote&gt;Uncaught Resource &amp;#39; igGrid&amp;#39; cannot be found. Please check that the resource name is correct.&lt;/blockquote&gt;
&lt;h2&gt;Do This&lt;/h2&gt;
&lt;pre&gt;$.ig.loader({
    scriptPath: &amp;quot;http://localhost/ig_ui/js/&amp;quot;,
    cssPath: &amp;quot;http://localhost/ig_ui/css/&amp;quot;,
    resources: &amp;quot;igGrid,igGrid.Paging&amp;quot;
});&lt;/pre&gt;
&lt;p&gt;Note that the space is now removed and this code now executes as expected.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads" target="_blank"&gt;&lt;img src="http://users.infragistics.com/ignite/IgniteUI_Banner_300x250_a2.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=389246" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="Ignite UI" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Ignite+UI/default.aspx" /></entry><entry><title>5 Tips for Configuring Ignite UI Grid Columns</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/11/14/5-tips-for-configuring-ignite-ui-grid-columns.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/11/14/5-tips-for-configuring-ignite-ui-grid-columns.aspx</id><published>2012-11-14T19:44:00Z</published><updated>2012-11-14T19:44:00Z</updated><content type="html">&lt;p&gt;The default settings found in the Ignite UI igGrid make working with data easy, but with a little customization you can quickly change how the data appears in each column.&lt;/p&gt;
&lt;p&gt;&lt;img title="5 tips for configuring Ignite UI grid columns" alt="5 tips for configuring Ignite UI grid columns" src="http://dl.infragistics.com/community/images/craigs/blog/2012/5-tips-for-configuring-igniteui-grid-columns.jpg" /&gt;&lt;/p&gt;
&lt;h2&gt;1. Manually Define Columns&lt;/h2&gt;
&lt;p&gt;The first step to taking control of how data renders in the grid is to turn off &lt;i&gt;autoGenerateColumns&lt;/i&gt; and manually define columns to explicitly set each of the column&amp;rsquo;s options.&lt;/p&gt;
&lt;p&gt;Options available for each column are:&lt;/p&gt;
&lt;table border="1" cellspacing="3" cellpadding="3" style="border-collapse:collapse;"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th valign="top"&gt;Setting&lt;/th&gt;&lt;th valign="top"&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;dataType&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Represents the data type of the underlying data for the field being bound to the column.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;format&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Defines how the grid should interpret the data in the column to format for display in the grid cell.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;formatter&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;References a function that is responsible for formatting the column value.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;headerText&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Text string that appears in the header of the column.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;hidden&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Boolean value indicating whether or not the column is hidden from the when the grid is rendered.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;key&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Points to key value used to look up the data value to render in the cell.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;template&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;String-based template for customizing the contents of the cell.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;width&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Pixel-based value for the width of the column.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;2. Define the format&lt;/h2&gt;
&lt;p&gt;The &lt;i&gt;format&lt;/i&gt; column option allows you to take control over how the data is rendered in the grid for a specified column. Depending on what type of data is provided to the column the format options vary.&lt;/p&gt;
&lt;h3&gt;Date&lt;/h3&gt;
&lt;p&gt;The following table depicts how the different format modes render the raw &lt;i&gt;date&lt;/i&gt; value of &lt;i&gt;8/13/2012&lt;/i&gt;.&lt;/p&gt;
&lt;table border="1" cellspacing="3" cellpadding="3" style="border-collapse:collapse;"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th valign="top"&gt;Format&lt;/th&gt;&lt;th valign="top"&gt;Result&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;date&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;8/13/2012&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;dateLong&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Monday, August 13, 2012&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;dateTime&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;8/13/2012 3:34 PM&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;time&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;3:35 PM&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;timeLong&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;3:35:17 PM&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;MM/dd/yyy&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;08/13/2012&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;MMMM&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;August&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;mmm-d, yy&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Aug-13, 12&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;yy&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;12&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;h:mm:ss tt&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;3:37:40&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;dddd d MMM&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Monday 13 Aug&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Number&lt;/h3&gt;
&lt;p&gt;The following table depicts how the different format modes render the raw &lt;i&gt;number&lt;/i&gt; value of &lt;i&gt;151324.912834098234&lt;/i&gt;.&lt;/p&gt;
&lt;table border="1" cellspacing="3" cellpadding="3" style="border-collapse:collapse;"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th valign="top"&gt;Format&lt;/th&gt;&lt;th valign="top"&gt;Result&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;number&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,324.91&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;int&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,325&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;currency&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;$151,324.91&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;percent&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,324.91%&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;#.###&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,324.913&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;0.000&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,324.913&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;0&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,325&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;double&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;151,324.91&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The double format is similar to number, with unlimited maximum number of decimal places.&lt;/p&gt;
&lt;h3&gt;Other Formats&lt;/h3&gt;
&lt;table border="1" cellspacing="3" cellpadding="3" style="border-collapse:collapse;"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th valign="top"&gt;Format&lt;/th&gt;&lt;th valign="top"&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;string&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;No special formatting &amp;ndash; renders the string value as-is in from the data source.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;bool&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Renders the string &amp;lsquo;true&amp;rsquo; when the value is &lt;i&gt;true&lt;/i&gt; and nothing when the value is &lt;i&gt;false&lt;/i&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;i&gt;checkbox&lt;/i&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="top"&gt;
&lt;p&gt;Renders a checked checkbox image (not an input element) if the value is &lt;i&gt;true&lt;/i&gt; and an unchecked image if the value is &lt;i&gt;false&lt;/i&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;3. Use the {0} replacement token for strings&lt;/h2&gt;
&lt;p&gt;When working with &lt;i&gt;string&lt;/i&gt; typed columns, you can use the &lt;i&gt;{0}&lt;/i&gt; replacement token to represent the incoming data value in a format string. For example if you want to add the standard prefix of &amp;ldquo;INV&amp;rdquo; to an identification string in the grid you can define the &lt;i&gt;format&lt;/i&gt; as:&lt;/p&gt;
&lt;pre&gt;$(&amp;quot;#grid&amp;quot;).igGrid({
	columns: [
	{
		headerText : &amp;quot;Part&amp;quot;,
		key: &amp;quot;PartNumber&amp;quot;,
		format: &amp;quot;INV-{0}&amp;quot;
	}],
	autoGenerateColumns: false,
	dataSource: data
});&lt;/pre&gt;
&lt;h2&gt;4. Add a formatter Function&lt;/h2&gt;
&lt;p&gt;The formatter option points to a function that allows you to evaluate the incoming data value and implement custom logic. The formatter function must take an argument of the incoming value and must return a string.&lt;/p&gt;
&lt;p&gt;Consider a grid where you want to indicate whether or not a contact is a minor by adding the string &amp;ldquo;(minor)&amp;rdquo; next to the &lt;i&gt;age&lt;/i&gt; value in the column. The resulting formatter function would look something like this:&lt;/p&gt;
&lt;pre&gt;function ageFormatter(age) {
	if(age &amp;gt; 18){
		age += &amp;quot; (minor)&amp;quot;;
	}

	return age;
}&lt;/pre&gt;
&lt;p&gt;To use the function you set the &lt;i&gt;formatter&lt;/i&gt; option to point to the function:&lt;/p&gt;
&lt;pre&gt;$(&amp;quot;#grid&amp;quot;).igGrid({
	columns: [{
		headerText: &amp;quot;Age&amp;quot;,
		key: &amp;quot;Age&amp;quot;,
		dateType: &amp;quot;number&amp;quot;,
		formatter: ageFormatter
	}],
	
	autoGenerateColumns: false,	
	dataSource: data
});&lt;/pre&gt;
&lt;p&gt;The formatter function is then run each time a value is bound to that column for each row.&lt;/p&gt;
&lt;h2&gt;5. Create a Custom Template&lt;/h2&gt;
&lt;p&gt;If you want to have fine-grained control and use data from other columns in your column format, then you want to create a custom template. The template engine used for grid columns is a string-based template so a simple template which renders a contact&amp;rsquo;s first name would look like this:&lt;/p&gt;
&lt;pre&gt;template: &amp;quot;${firstName}&amp;quot;&lt;/pre&gt;
&lt;p&gt;This approach works well if you are injecting in the data from the given column you are defining. If you want to make data from another column available to your template, then you must include a hidden column which is bound to the key you need in your template. The following template demonstrates how to create a link around the person&amp;rsquo;s first name using the person&amp;rsquo;s ID:&lt;/p&gt;
&lt;pre&gt;$(&amp;quot;#grid&amp;quot;).igGrid({
	columns: [
	{
		hidden: true,
		key: &amp;quot;ID&amp;quot;
	},
	{
		headerText: &amp;quot;First Name&amp;quot;,
		key: &amp;quot;firstName&amp;quot;, 
		template: &amp;quot;&lt;a href="http://www.infragistics.com/community/controlpanel/blogs/${ID}.html"&gt;${firstName}&lt;/a&gt;&amp;quot;
	}],
	autoGenerateColumns: false,
	dataSource: data
});&lt;/pre&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads"&gt;&lt;img alt="" src="http://users.infragistics.com/ignite/IgniteUI_Banner_300x250_a1.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=381636" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="jQuery" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/jQuery/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Grid/default.aspx" /><category term="Ignite UI" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Ignite+UI/default.aspx" /></entry><entry><title>4 Steps to Binding XML Data to the Ignite UI Grid</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/10/23/4-steps-to-binding-xml-data-to-the-ignite-ui-grid.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/10/23/4-steps-to-binding-xml-data-to-the-ignite-ui-grid.aspx</id><published>2012-10-23T15:48:00Z</published><updated>2012-10-23T15:48:00Z</updated><content type="html">&lt;p&gt;The Ignite UI Grid is a flexible jQuery and HTML-based grid control that can be bound to many different types of data sources - and XML data is no exception. &lt;/p&gt;

&lt;p&gt;&lt;img alt="4 Steps to Binding XML Data to the Ignite UI Grid" src="http://dl.infragistics.com/community/images/craigs/blog/2012/4-steps-to-binding-xml-data-to-the-igniteui-grid.jpg" /&gt;&lt;/p&gt;

&lt;h2&gt;1. Get the Data&lt;/h2&gt;

&lt;p&gt;To begin, you first need to get data on your page. In this case your page needs to have XML either locally available on the page or as the result of an AJAX call. &lt;/p&gt;

&lt;p&gt;For simplicity’s sake the code example that accompanies this post has XML data local to the page.&lt;/p&gt;

&lt;pre&gt;var xmlDoc = &amp;#39;&amp;lt;People&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;Person Name=&amp;quot;Gustavo Achong&amp;quot;&amp;gt;&amp;#39; +
        &amp;#39;&amp;lt;Details Age=&amp;quot;42&amp;quot; Email=&amp;quot;gachong@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;Person Name=&amp;quot;Catherine Abel&amp;quot;&amp;gt;&amp;#39; +
        &amp;#39;&amp;lt;Details Age=&amp;quot;27&amp;quot; Email=&amp;quot;cabel@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;Person Name=&amp;quot;Kim Abercrombie&amp;quot;&amp;gt;&amp;#39; +
        &amp;#39;&amp;lt;Details Age=&amp;quot;33&amp;quot; Email=&amp;quot;kabercrombie@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
    &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
&amp;#39;&amp;lt;/People&amp;gt;&amp;#39;;&lt;/pre&gt;

&lt;h2&gt;2. Create the Schema&lt;/h2&gt;

&lt;p&gt;Once you have data available, then you need to create a schema. Since XML is a very flexible data structure schemas are necessary to provide a way for the data source component to know how to interpret the incoming XML.&lt;/p&gt;

&lt;p&gt;The &lt;i&gt;searchField&lt;/i&gt; option is configured to point to &lt;i&gt;//Person&lt;/i&gt; which points to the root of the XML element which represents a record in the grid. &lt;/p&gt;

&lt;p&gt;Each of the columns in the grid is mapped to &lt;i&gt;fields &lt;/i&gt;in the XML schema. In this case, the root &lt;i&gt;Person&lt;/i&gt; element has only one child element with a few attributes that are extracted using &lt;a href="http://www.w3schools.com/xpath/"&gt;XPath syntax&lt;/a&gt; to create the appropriate schema.&lt;/p&gt;

&lt;pre&gt;var xmlSchema = new $.ig.DataSchema(&amp;quot;xml&amp;quot;, { 
    //searchField serves as the base node(s) for the XPaths
    searchField: &amp;quot;//Person&amp;quot;, 
    fields: [
        { name: &amp;quot;Name&amp;quot;, xpath: &amp;quot;./@Name&amp;quot; },
        { name: &amp;quot;Email&amp;quot;, xpath: &amp;quot;Details/@Email&amp;quot; },
        { name: &amp;quot;Age&amp;quot;, xpath: &amp;quot;Details/@Age&amp;quot; }
    ]
});&lt;/pre&gt;

&lt;h2&gt;3. Create the Data Source&lt;/h2&gt;

&lt;p&gt;Now that the raw XML data is being shaped by the schema, the two are paired together using the data source control.&lt;/p&gt;

&lt;pre&gt;var ds = new $.ig.DataSource({
    type: &amp;quot;xml&amp;quot;,
    dataSource: xmlDoc,
    schema: xmlSchema 
});&lt;/pre&gt;

&lt;h2&gt;4. Bind to the Grid&lt;/h2&gt;

&lt;p&gt;Finally the grid is instantiated with the &lt;i&gt;dataSource&lt;/i&gt; option set to the instance of the data source.&lt;/p&gt;

&lt;pre&gt;$(&amp;quot;#grid&amp;quot;).igGrid({
    dataSource: ds
});&lt;/pre&gt;

&lt;h2&gt;Full Source Code&lt;/h2&gt;

&lt;p&gt;To see it all working together, the following is the full source code.&lt;/p&gt;

&lt;pre&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;script src=&amp;quot;../js/modernizr.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;../js/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;../js/jquery-ui.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;http://localhost/ig_ui/js/infragistics.loader.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

    &amp;lt;table id=&amp;quot;grid&amp;quot;&amp;gt;&amp;lt;/table&amp;gt;

    &amp;lt;script&amp;gt;
        // The ig.loader is used to load required IgniteUI JavaScript 
        // and CSS resources. It accepts a configuration object that specifies
        // default paths and the components to load into the page.
        $.ig.loader({
            scriptPath: &amp;#39;http://localhost/ig_ui/js/&amp;#39;,
            cssPath: &amp;#39;http://localhost/ig_ui/css/&amp;#39;,

            //string representing which component resources are required
            resources: &amp;quot;igDataSource,igGrid&amp;quot;
        });

        //The ig.loader accepts a function that is called after 
        //all resources are loaded and document.ready has fired.
        $.ig.loader(function () {
                        
            //Sample XML Data
            var xmlDoc = &amp;#39;&amp;lt;People&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;Person Name=&amp;quot;Gustavo Achong&amp;quot;&amp;gt;&amp;#39; +
                    &amp;#39;&amp;lt;Details Age=&amp;quot;42&amp;quot; Email=&amp;quot;gachong@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;Person Name=&amp;quot;Catherine Abel&amp;quot;&amp;gt;&amp;#39; +
                    &amp;#39;&amp;lt;Details Age=&amp;quot;27&amp;quot; Email=&amp;quot;cabel@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;Person Name=&amp;quot;Kim Abercrombie&amp;quot;&amp;gt;&amp;#39; +
                    &amp;#39;&amp;lt;Details Age=&amp;quot;33&amp;quot; Email=&amp;quot;kabercrombie@adventureworks.com&amp;quot; /&amp;gt;&amp;#39; +
                &amp;#39;&amp;lt;/Person&amp;gt;&amp;#39; +
            &amp;#39;&amp;lt;/People&amp;gt;&amp;#39;;

            //Binding to XML requires a schema to define data fields
            var xmlSchema = new $.ig.DataSchema(&amp;quot;xml&amp;quot;, { 
                //searchField serves as the base node(s) for the XPaths
                searchField: &amp;quot;//Person&amp;quot;, 
                fields: [
                    { name: &amp;quot;Name&amp;quot;, xpath: &amp;quot;./@Name&amp;quot; },
                    { name: &amp;quot;Email&amp;quot;, xpath: &amp;quot;Details/@Email&amp;quot; },
                    { name: &amp;quot;Age&amp;quot;, xpath: &amp;quot;Details/@Age&amp;quot; }
                ]
            });

            //This creates an Infragistics datasource from the XML 
            //and the Schema which can be consumed by the grid.
            var ds = new $.ig.DataSource({
                type: &amp;quot;xml&amp;quot;,
                dataSource: xmlDoc,
                schema: xmlSchema 
            });

            $(&amp;quot;#grid&amp;quot;).igGrid({
                dataSource: ds //$.ig.DataSource defined above
            });

        });

    &amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads"&gt;&lt;img alt="" src="http://users.infragistics.com/ignite/IgniteUI_Banner_300x250_a1.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=378398" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="jQuery" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/jQuery/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Grid/default.aspx" /><category term="XML" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/XML/default.aspx" /><category term="Ignite UI" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Ignite+UI/default.aspx" /></entry><entry><title>Changes to the Help Installers in NetAdvantage 2012.2</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/10/18/changes-to-the-help-installers-in-netadvantage-2012-2.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/10/18/changes-to-the-help-installers-in-netadvantage-2012-2.aspx</id><published>2012-10-18T14:19:00Z</published><updated>2012-10-18T14:19:00Z</updated><content type="html">&lt;h2&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Help installers for Visual Studio 2008 are no longer available&lt;/li&gt;
&lt;li&gt;The installer now supports Visual Studio 2010, Service Pack 1 (Help Viewer 1.1) and Visual Studio 2012 (Help Viewer 2.0)&lt;/li&gt;
&lt;li&gt;There is a repairable known issue if you have both Visual Studio 2010, SP1 and Visual Studio 2012 installed on your machine&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Available Help Formats&lt;/h2&gt;
&lt;p&gt;With the release of NetAdvantage 2012.2 we have made some changes to the available help installers that accompany our products which use the Visual Studio help format. First, we are no longer shipping help for Visual Studio 2008 (Help 2.X). The help versions that are now available are for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visual Studio 2010, Service Pack 1 (Help Viewer 1.1)&lt;/li&gt;
&lt;li&gt;Visual Studio 2012 (Help Viewer 2.0)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We require the Visual Studio 2010, SP1 at a minimum because this allows us to ship pre-generated index files, which ultimately speeds up install time for both formats.&lt;/p&gt;
&lt;h2&gt;Known Issue&lt;/h2&gt;
&lt;p&gt;If you have &lt;b&gt;both &lt;/b&gt;Visual Studio 2010, SP1 and Visual Studio 2012 installed, but do not have the local store setup for Visual Studio 2010, SP1, then the only help that is installed on the system is the Visual Studio 2012 format.&lt;/p&gt;
&lt;h2&gt;Fix&lt;/h2&gt;
&lt;p&gt;If you want the help in the Visual Studio 2010 format, then you need to to setup the local store. To do this, launch &lt;strong&gt;Manage Help Settings&lt;/strong&gt; utility under &lt;strong&gt;Start &amp;gt; Microsoft Visual Studio 2010 &amp;gt; Tools &amp;gt; Manage Help Settings &amp;ndash; ENU&lt;/strong&gt;. Then select the location you wish to create the local store and press OK.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Set Local Visual Studio Content Location Dialog" src="http://users.infragistics.com/craigs/images/blog/set-local-content-location-dialog.png" /&gt;&lt;/p&gt;
&lt;p&gt;Once you have setup the local store you can run a &lt;b&gt;Repair&lt;/b&gt; mode on the NetAdvantage help installer to register with Visual Studio 2010, SP1.&lt;/p&gt;
&lt;p&gt;Alternatively, you could also manually install the help, after setting up the local store, which is detailed in &lt;a href="http://www.infragistics.com/community/blogs/tom_puglisi/archive/2010/05/04/installing-visual-studio-2010-help-for-netadvantage-windows-forms-and-asp-net-products.aspx" target="_blank"&gt;Installing Visual Studio 2010 Help for NetAdvantage for Windows Forms and ASP.NET Products&lt;/a&gt;, but the process now applies to all product lines.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; If you are running on an x64 operating system, and only have Visual Studio 2012 installed on your machine then the NetAdvantage Platform installer does not all you to install help of any format. This issue is being addressed an we hope to have a fix available shortly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=377727" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="installers" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/installers/default.aspx" /><category term="help" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/help/default.aspx" /></entry><entry><title>Ignite UI Grid in the Desktop Browser and iPad</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/10/12/igniteui-grid-in-the-desktop-browser-and-ipad.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/10/12/igniteui-grid-in-the-desktop-browser-and-ipad.aspx</id><published>2012-10-12T21:40:00Z</published><updated>2012-10-12T21:40:00Z</updated><content type="html">&lt;p&gt;One of the great characteristics of the Ignite UI jQuery grid is how well it works in both desktop and mobile environments. In this video I demonstrate the grid working with a number of interactive features enabled and you can see it working on an iPad as well as a desktop browser.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=Zih4dsGmSCA"&gt;&lt;img src="http://users.infragistics.com/craigs/images/blog/igniteui-grid-in-the-desktop-browser-and-ipad.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/products/jquery/downloads"&gt;&lt;img src="http://users.infragistics.com/ignite/IgniteUI_Banner_300x250_a1.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=376871" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="jQuery" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/jQuery/default.aspx" /><category term="HTML5" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/HTML5/default.aspx" /><category term="iPad" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/iPad/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/Grid/default.aspx" /></entry><entry><title>ReportPlus How-To Videos</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/09/19/reportplus-how-to-videos.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/09/19/reportplus-how-to-videos.aspx</id><published>2012-09-19T21:10:00Z</published><updated>2012-09-19T21:10:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-dashboard.png" width="400" height="292" alt="ReportPlus dashboard" /&gt;&lt;/p&gt;
&lt;p&gt;Are you eager to get to know ReportPlus? Take a few minutes to check out the following videos that cover the basics as well as some in-depth features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://youtu.be/28ntjGQMg4Q" target="_blank"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://youtu.be/B46wGISc3ZI" target="_blank"&gt;Charts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://youtu.be/n12jVicr2Us" target="_blank"&gt;Filtering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://youtu.be/r9ECfcalSzI" target="_blank"&gt;Maps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=373419" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="business intelligence" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/business+intelligence/default.aspx" /><category term="iPad" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/iPad/default.aspx" /><category term="reporting" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/reporting/default.aspx" /></entry><entry><title>iPad + You = Enterprise Reporting</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/09/19/ipad-you-enterprise-reporting.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/09/19/ipad-you-enterprise-reporting.aspx</id><published>2012-09-19T13:16:00Z</published><updated>2012-09-19T13:16:00Z</updated><content type="html">&lt;p&gt;Which of these statements resonates most with you?&lt;/p&gt;
&lt;blockquote&gt;&amp;quot;Management wants a reporting dashboard.&amp;quot;&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;&amp;quot;The client needs a reporting solution with the app we just delivered.&amp;quot;&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;&amp;quot;You can&amp;rsquo;t manage what you don&amp;rsquo;t measure.&amp;quot;&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Reporting against data is a natural extension of just about any application. Beyond that, typical business environments are replete with data warehouses, SharePoint installs, web services and other data structures with data eagerly awaiting analysis.&lt;/p&gt;
&lt;p&gt;Usually reports are coded from the ground up because stock reporting solutions just don&amp;rsquo;t suffice. The needs of each organization are unique to the business and often require some finesse. Unfortunately this &amp;ldquo;finesse&amp;rdquo; comes at the cost of more code to write and maintain, more licenses for reporting development and server environments, more work for IT support staff - and the list goes on.&lt;/p&gt;
&lt;p&gt;Wouldn&amp;rsquo;t it be great if you could just connect to these data services and build reports that make sense on something as easy-to-use as your iPad?&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-dashboard.png" width="400" height="292" alt="ReportPlus dashboard" /&gt;&lt;/p&gt;
&lt;p&gt;Yes, indeed - meet ReportPlus!&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-logo.png" width="350" height="69" alt="ReportPlus logo" /&gt;&lt;/p&gt;
&lt;p&gt;ReportPlus is a self-service business intelligence tool which makes it easy for you to connect to enterprise data sources and quickly get started. Using nothing but standard gestures and interactions you can build reports all on the iPad. Now when I say enterprise data sources that means data as formally structured as SQL Server Reporting Services to data thrown together in an Excel sheet &amp;ndash; it&amp;rsquo;s just that flexible.&lt;/p&gt;
&lt;h2&gt;Building Reports&lt;/h2&gt;
&lt;p&gt;Once you&amp;rsquo;ve chosen a data source then you can easily build pivot tables, sort and filter your data and select a visualization style.&lt;/p&gt;
&lt;p&gt;You have complete control over the fields that show up in your report. You can even drag and drop items in the Fields list to reorder the fields in the report.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-fields.png" width="530" height="581" alt="ReportPlus fields" /&gt;&lt;/p&gt;
&lt;p&gt;The pivot editor gives you the ability to slice-and-dice data in ways that make the most sense to you. You can even add ad-hoc filtering by dragging fields into the &lt;i&gt;Filters&lt;/i&gt; placeholder.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-placeholders.png" width="530" height="510" alt="ReportPlus pivot editor" /&gt;&lt;/p&gt;
&lt;p&gt;Once the data is shaped the way you want it then you select a visualization type. There are a host of visualization options that range from single and multi-series charts, maps and text.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-visualization.png" width="530" height="510" alt="ReportPlus visualizations" /&gt;&lt;/p&gt;
&lt;p&gt;Then you can fine-tune the final result by adding conditional filters, configuring the data fields or decide on the final look of the visualization.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-options.png" width="530" height="510" alt="ReportPlus options" /&gt;&lt;/p&gt;
&lt;p&gt;Once the dashboard is complete you can choose to share either with other ReportPlus users or anyone with an email address. Existing ReportPlus users can have access to the source dashboard file and those without an iPad or ReportPlus can access either screenshots or PowerPoint presentations sent directly to their inbox.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.infragistics.com/community/images/craigs/blog/2012/reportplus-dashboard.png" width="400" height="292" alt="ReportPlus dashboard" /&gt;&lt;/p&gt;
&lt;p&gt;For more details and quick overview, &lt;a href="http://www.youtube.com/watch?v=28ntjGQMg4Q&amp;amp;feature=plcp"&gt;check out the ReportPlus introduction video&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, for me, ReportPlus is really exciting because now the tedious task of building reports is just as simple as tapping away at your iPad. &lt;a href="http://itunes.apple.com/us/app/reportplus-self-service-mobile/id556853421" target="_blank"&gt;ReportPlus is available in the App Store here&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;b&gt;Full Disclosure:&lt;/b&gt; Yes, I am the voice of the &lt;a href="http://youtube.com/user/reportplus" target="_blank"&gt;ReportPlus videos&lt;/a&gt;, but I am also a developer and I truly would rather do reporting the ReportPlus way rather than build them from scratch ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=373315" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="business intelligence" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/business+intelligence/default.aspx" /><category term="iPad" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/iPad/default.aspx" /><category term="reporting" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/reporting/default.aspx" /></entry><entry><title>Avoiding Remote Desktop Connection Error: Console Session in Progress</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/08/21/avoiding-remote-desktop-connection-error-console-session-in-progress.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/08/21/avoiding-remote-desktop-connection-error-console-session-in-progress.aspx</id><published>2012-08-21T13:33:00Z</published><updated>2012-08-21T13:33:00Z</updated><content type="html">&lt;p&gt;I&amp;#39;ve recently ran into run into a remote desktop connection error where the error message:&lt;/p&gt;
&lt;blockquote&gt;Your computer could not connect to another console session on the remote computer because you already have a console session in progress.&lt;/blockquote&gt;
&lt;p&gt;...doesn&amp;#39;t exactly do justice as to what was really happening. &lt;a href="http://drazz75.com/2012/08/21/avoiding-remote-desktop-connection-error-console-session-in-progress/"&gt;I detail the workaround here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=368735" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author></entry><entry><title>2 Step Process to Upgrade Windows 8 JavaScript Applications from RC to RTM</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/08/17/2-step-process-to-upgrade-windows-8-javascript-applications-from-rc-to-rtm.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/08/17/2-step-process-to-upgrade-windows-8-javascript-applications-from-rc-to-rtm.aspx</id><published>2012-08-17T18:30:00Z</published><updated>2012-08-17T18:30:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://dl.infragistics.com/community/images/craigs/blog/2012/08/2-step-process-to-upgrade-windows8-javascript-applications-from-rc-to-rtm.jpg" alt="2 Step Process to Upgrade Windows 8 JavaScript Applications from RC to RTM" /&gt;&lt;/p&gt;
&lt;p&gt;Now that Windows 8 and Visual Studio 2012 are in their final state you may have a number of Windows 8 JavaScript projects built with the RC of Visual Studio 2012 that now need an upgrade to RTM bits. The upgrade process is simple: update the WinJS project reference and update the markup.&lt;/p&gt;
&lt;h2&gt;Update the WinJS Reference&lt;/h2&gt;
&lt;p&gt;The Windows 8 JavaScript project template includes a reference to WinJS by default. When you open a project build with the RC in the final version of Visual Studio you&amp;rsquo;ll see a broken reference.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dl.infragistics.com/community/images/craigs/blog/2012/08/remove-winjs-rc-reference.png" alt="Broken WinJS Reference from RC project in Visual Studio 2012 RTM" /&gt;&lt;/p&gt;
&lt;p&gt;To update the reference to RTM, delete the broken reference, open the &lt;em&gt;Add Reference&lt;/em&gt; dialog and select the &lt;em&gt;Windows Library for JavaScript 1.0&lt;/em&gt; Windows Extension.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dl.infragistics.com/community/images/craigs/blog/2012/08/add-winjs-reference.png" alt="Add WinJS RTM reference" /&gt;&lt;/p&gt;
&lt;h2&gt;Update the Markup&lt;/h2&gt;
&lt;p&gt;HTML pages that accompany Windows 8 JavaScript applications include references to style sheets and JavaScript files that are embedded in WinJS itself. The RC markup includes a suffix of &amp;quot;.RC&amp;quot; in the HTML markup referencing these resources:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dl.infragistics.com/community/images/craigs/blog/2012/08/winjs-rc-markup.png" alt="WinJS RC Markup" /&gt;&lt;/p&gt;
&lt;p&gt;To upgrade the markup do a Search and Replace (throughout the entire solution) replacing &lt;code&gt;Microsoft.WinJS.1.0.RC&lt;/code&gt; with &lt;code&gt;Microsoft.WinJS.1.0&lt;/code&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dl.infragistics.com/community/images/craigs/blog/2012/08/winjs-rtm-markup.png" alt="WinJS RTM Markup" /&gt;&lt;/p&gt;
&lt;h4&gt;You&amp;rsquo;re all Done!&lt;/h4&gt;
&lt;p&gt;Now just run your app to test and ensure everything else works as expected.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: There may be some cases where other adjustments may be necessary if any API changes occurred between RC and RTM, these steps should your old projects at least running in the final environment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=368303" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="winjs" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/winjs/default.aspx" /></entry><entry><title>3 Essential Tips for ASP.NET Developers Moving to WinJS / Metro Application Development</title><link rel="alternate" type="text/html" href="/community/blogs/craig_shoemaker/archive/2012/05/14/3-essential-tips-for-asp-net-developers-moving-to-winjs-metro-application-development.aspx" /><id>/community/blogs/craig_shoemaker/archive/2012/05/14/3-essential-tips-for-asp-net-developers-moving-to-winjs-metro-application-development.aspx</id><published>2012-05-14T21:41:00Z</published><updated>2012-05-14T21:41:00Z</updated><content type="html">&lt;p&gt;&lt;img title="ASP.NET to WinJS / Windows8 Development" src="http://dl.infragistics.com/community/images/craigs/blog/2012-05-14/aspnet-to-winrt-windows8-development.png" alt="ASP.NET to WinJS / Windows8 Development" width="291" height="308" style="float:left;margin:10px;" /&gt;&lt;/p&gt;
&lt;p&gt;One of the most exciting announcements surrounding &lt;a href="http://www.infragistics.com/windows8.aspx"&gt;Windows 8&lt;/a&gt; development is the fact that you can create Metro-style applications in HTML 5 and JavaScript. This means that you as a web developer can leverage your existing skills and tools and to develop Windows applications.&lt;/p&gt;
&lt;p&gt;However, moving from traditional web development to WinJS (a.k.a. Metro-style or Windows 8 applications) development can be a bit of an adjustment if you are an &lt;a href="http://www.infragistics.com/dotnet/netadvantage/aspnet.aspx"&gt;ASP.NET&lt;/a&gt; developer by trade. Therefore here are a few tips to help you keep your head on straight as you make your way into WinJS development.&lt;/p&gt;
&lt;h2&gt;tl;dr&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You can take your existing skills as a web developer and apply them to WinJS, but not everything transfers and you&amp;rsquo;ll have to fill in some gaps.&lt;/li&gt;
&lt;li&gt;Grasping the inherent difference between stateless and stateful applications and learning the new UI framework is at the core of a successful switch from ASP.NET to WinRT applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;1: There is No Server&lt;/h2&gt;
&lt;p&gt;As web developers we are used to stateless client-server architecture of our applications. We are used to the concept of a distinction between server-side code and markup. We&amp;rsquo;re used to the constraints of session, view state and have adapted to the benefits of Ajax to help increase the effectiveness and responsiveness of our applications. It might seem like I am stating the obvious because WinRT development after all &lt;strong&gt;is&lt;/strong&gt; Windows development by definition, but when you use web technologies (that&amp;nbsp;you&amp;#39;ve&amp;nbsp;grown accustomed to using for the last decade or so) without the existence of a server - it can be a bit of a paradigm shift without a clutch. Further, web servers are expected to be more or less reliable and available. A Windows 8 application can be suspended, resumed or even terminated with very little ceremony.&lt;/p&gt;
&lt;h3&gt;Practical Implications&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Classic stateless challenges disappear&lt;/li&gt;
&lt;li&gt;Classic stateful challenges appear (For instance, once you load a CSS file into a page it doesn&amp;rsquo;t go away just because you navigate to a new page. This could cause problems if you&amp;rsquo;re not careful.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2: No Generated Markup&lt;/h2&gt;
&lt;p&gt;While working with a binding template that wasn&amp;rsquo;t rendering correctly, I opened the Visual Studio DOM Explorer looking for a value I had applied to an element&amp;#39;s &lt;i&gt;class&lt;/i&gt; property. The value didn&amp;rsquo;t get applied because I tried to apply it directly to the &lt;em&gt;class&lt;/em&gt; property (which is exactly what you would do if you were working with a server control). Looking back on this face-palm moment I realized that it should have been obvious to me that a JavaScript binding was at play instead of my normal thinking of &amp;ldquo;generated HTML by the server&amp;rdquo;. Instead of setting the &lt;em&gt;class&lt;/em&gt; property I needed to set the &lt;em&gt;className&lt;/em&gt; property as &lt;em&gt;className&lt;/em&gt; is the valid JavaScript notation to set the &lt;em&gt;class&lt;/em&gt; property of an element.&lt;/p&gt;
&lt;h3&gt;Practical Implications&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;WinJS applications use JavaScript exclusively to manipulate the view &amp;ndash; all the same rules apply&lt;/li&gt;
&lt;li&gt;Technically markup is generated in the view, but it&amp;rsquo;s not generated into the markup stream. New elements are generated in-memory by JavaScript when you are dynamically manipulating the DOM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;3. There is a Learning Curve&lt;/h2&gt;
&lt;p&gt;Remember how we said you could write Windows 8 applications with HTML and JavaScript? Well that&amp;rsquo;s all true, but that&amp;nbsp;doesn&amp;#39;t&amp;nbsp;mean that the same .NET framework APIs you&amp;rsquo;re used to are available. For instance: Want to send an email? Go for it, but you won&amp;rsquo;t be using &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.mail.aspx"&gt;System.Net.Mail&lt;/a&gt; to make it happen. Have an existing business logic layer that you want to expose to a Metro app? Well, you&amp;rsquo;ll need to create a &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br230301(v=vs.110).aspx"&gt;WinMD&lt;/a&gt; wrapper or expose it via an &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br229787.aspx"&gt;xhr&lt;/a&gt; request. If you are directly referencing managed code, you must make sure you only expose &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br230301(v=vs.110).aspx#PassingToManaged"&gt;Windows Runtime Types as return types and parameters in your methods&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Further, the WinRT framework comes with a host of new controls, animations and design considerations that were never at play in the past. For instance you may be a wizard at jQuery UI, but those same controls may not present as well in a Metro application as they do in a web application.&lt;/p&gt;
&lt;h3&gt;Practical Implications&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Working with managed code in WinRT is similar to, but not the same as writing the run-of-the-mill .NET application&lt;/li&gt;
&lt;li&gt;There are new design considerations and UI patterns&amp;nbsp; to learn and apply appropriately&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. It&amp;rsquo;s a &amp;lsquo;State&amp;rsquo; of Mind (Bonus!)&lt;/h2&gt;
&lt;p&gt;As I&amp;rsquo;ve alluded to above, a big part of making the switch is fully grasping stateful application development. Let me give you an example. ASP.NET developers are used to a page event lifecycle where a request comes into the page which is usually first handled by &lt;em&gt;Page_Load&lt;/em&gt; then control event handlers fire then you have a final chance to interact with the page at &lt;em&gt;Pre_Render&lt;/em&gt; and then you&amp;rsquo;re done. Many of these events are indicative of the statelessness of a web page. In a Metro application you&amp;rsquo;ll handle the &lt;em&gt;activation&lt;/em&gt; event (roughly equivalent to the jQuery &lt;em&gt;ready &lt;/em&gt;event) , the &lt;em&gt;suspended&lt;/em&gt; event and the &lt;em&gt;restored&lt;/em&gt; event (which coincidentally are indicative of the statefulness of a native application).&lt;/p&gt;
&lt;h3&gt;Practical Implications&lt;/h3&gt;
&lt;p&gt;The stateful nature of a native application means that you will interact with controls and data in a different way than you would in an ASP.NET application. Issues like guarding against global variable pollution in JavaScript and allowing your application to gracefully handle being suspended, resumed or terminated become an important part of your development concerns.&lt;/p&gt;
&lt;h2&gt;What Do You Think?&lt;/h2&gt;
&lt;p&gt;What other aspects of the transition would you include in this list?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=350388" width="1" height="1"&gt;</content><author><name>craigshoemaker</name><uri>http://www.infragistics.com/profile/OTMzNw==</uri></author><category term="winjs" scheme="http://www.infragistics.com/community/blogs/craig_shoemaker/archive/tags/winjs/default.aspx" /></entry></feed>