<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: JQGrid databinding after model reloading - .net MVC</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>nerrad on JQGrid databinding after model reloading - .net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc#p30025</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc#p30025</guid>
        	        	<description><![CDATA[<p>here&#39;s how I reload it without calling $.ajax - i read through <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....ki:methods</a></p>
<p>jQuery("#AccountSearchGrid1").jqGrid(&#39;setGridParam&#39;, { url: "JobDefinition/AccountSearchGridDataRequest/?id=" + myKey, page: 1 }).trigger(&#39;reloadGrid&#39;);</p>
<p>So, please let me know if there is a better approach to this solution. And still I would like to know how to reload it under success inline in ajax call.</p>
<p>thanks.&#160;</p>
]]></description>
        	        	<pubDate>Mon, 23 Dec 2013 21:58:26 +0200</pubDate>
        </item>
        <item>
        	<title>nerrad on JQGrid databinding after model reloading - .net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc#p30024</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-databinding-after-model-reloading-net-mvc#p30024</guid>
        	        	<description><![CDATA[<p>I posted this on here <a href="http://stackoverflow.com/questions/20747489/jqgrid-databinding-with-mvc-reloading-data" rel="nofollow" target="_blank"><a href="http://stackoverflow.com/quest" rel="nofollow">http://stackoverflow.com/quest</a>.....ading-data</a></p>
<p>Am new to JQGrid. I set up the grid following the examples given here using the Html JQGrid helper class under my view.&#160;<a rel="nofollow" href="http://www.trirand.net/documentation/aspnetmvc/index.htm" target="_blank">Trirand MVC - JQGrid</a></p>
<p>from the example - it has 2 functions in the controller, first one is&#160;<strong>ActionResult PerformanceLinq()</strong>&#160;- which is just returning the view. second one is&#160;<strong>JsonResult DataRequested()</strong>&#160;- this returns the data in jqgrid model: return gridModel.OrdersGrid.DataBind(northWindModel.Orders);</p>
<p>So, I have all my data loaded perfectly, rendered. Done as far as the first step.</p>
<p>I have a textbox, and a search button (they both aren&#39;t JQGrid components). onclick event should trigger an ajax call to DataRequested() method, which I modified a bit passing a parameter. How can I refresh myGrid without rendering the page again?</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit2613' value='Select Code' data-codeid='sfcode2613' /></p><div class='sfcode' id='sfcode2613'>function GetAccountSearchGrid() {
        debugger;
        var myKey = document.getElementById(&#39;SearchKey&#39;).value; //this is searchKey value

        $.ajax({
            url: &#39;@Url.Action("AccountSearchGridDataRequest")&#39;,
            type: &#39;GET&#39;,
            data: {
                id: myKey
            },
            dataType: &#39;json&#39;,
            contentType: &#39;application/json&#39;,
            success: function (data) {                    
                jQuery(&#39;AccountSearchGrid1&#39;).jqGrid(&#39;clearGridData&#39;);
                jQuery(&#39;AccountSearchGrid1&#39;).jqGrid(&#39;setGridParam&#39;, { data: data });
                jQuery(&#39;AccountSearchGrid1&#39;).trigger(&#39;reloadGrid&#39;);
                //$(&#39;#AccountSearchGrid1&#39;).jqGrid(&#39;setGridParam&#39;, { data: data }).trigger(&#39;reloadGrid&#39;);
                //jQuery("#AccountSearchGrid1")[0].p.data = data;

            },
            error: function (data) {
                alert("error");
            }
        });
    }</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit2052' value='Select Code' data-codeid='sfcode2052' /></p><div class='sfcode' id='sfcode2052'><p>Please keep in mind that&#160;<strong>AccountSearchGridDataRequest(searchKey)</strong>&#160;returns a gridmodel&#160;</p><p>- so how can I bind the JsonResult into the grid, in Ajax success inline?<br />here&#39;s my c# controller code for getting the data</p><pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit627' value='Select Code' data-codeid='sfcode627' /></p><div class='sfcode' id='sfcode627'>public JsonResult AccountSearchGridDataRequest(string id)
        {
            JobDefinitionContact jc = new JobDefinitionContact();
            if (!String.IsNullOrEmpty(id)) { jc.CompanyName = id; }

            var jobDefServiceClient = new JobDefServiceClient();            
            var acctSearchResult = from i in jobDefServiceClient.GetAccountSearch(jc, "100")
                                   select i;
            IQueryable&#60;JobDefinitionContact&#62; searchItems = acctSearchResult.AsQueryable&#60;JobDefinitionContact&#62;();
            var gridModel = new JobDefinitionAccountSearchGridModel();
            SetUpGrid(gridModel.AccountSearchGrid, id);

            return gridModel.AccountSearchGrid.DataBind(searchItems);
        }</div></pre>
</div>
]]></description>
        	        	<pubDate>Mon, 23 Dec 2013 18:53:30 +0200</pubDate>
        </item>
</channel>
</rss>