<?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, MVC3 and FluentNhibernate: search by text, not by key</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key</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-mvc3-and-fluentnhibernate-search-by-text-not-by-key/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Festus on JQGrid, MVC3 and FluentNhibernate: search by text, not by key</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25362</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25362</guid>
        	        	<description><![CDATA[<p>I&#39;ve resolved the display issue by overriding the ToString() method for Status. As for the search issue, this is</p>
<p>what I&#39;ve discovered:</p>
<p>What is being returned in both cases is a JSonResult. However, when searched by Status, the query itself</p>
<p>returns the expected results, but when the grid.DataBind executes, the JSonResult.Data member becomes</p>
<p>an Object rather than a JSonResponse. Looking at the query results, I cannot see any difference in types or</p>
<p>structure (or even the data), and hence no reason for the lack of convertion from object to JSonResponse.</p>
]]></description>
        	        	<pubDate>Fri, 09 Dec 2011 18:43:30 +0200</pubDate>
        </item>
        <item>
        	<title>Festus on JQGrid, MVC3 and FluentNhibernate: search by text, not by key</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25333</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25333</guid>
        	        	<description><![CDATA[<p>Ok. Wow. Really sorry about the formatting above. It is better formatted at</p>
<p><a href="http://stackoverflow.com/questions/8360429/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key&#160;though" rel="nofollow" target="_blank"><a href="http://stackoverflow.com/quest" rel="nofollow">http://stackoverflow.com/quest</a>.....bsp;though</a> I don&#39;t think that is the</p>
<p>best forum for working with JQGrid.</p>
]]></description>
        	        	<pubDate>Tue, 06 Dec 2011 17:46:30 +0200</pubDate>
        </item>
        <item>
        	<title>Festus on JQGrid, MVC3 and FluentNhibernate: search by text, not by key</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25331</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-mvc3-and-fluentnhibernate-search-by-text-not-by-key#p25331</guid>
        	        	<description><![CDATA[<p>I am trying to implement an "as shipped" JQGrid search on a referenced field. I am having trouble displaying the text of the referenced Status model, as well as issues with the search not returning any results. Here are the models, map, viewmodel, controller, and view (as modeled after Trirand&#39;s demos):</p>
<p>Models:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit6495' value='Select Code' data-codeid='sfcode6495' /></p><div class='sfcode' id='sfcode6495'>public class Person 
{ 
    public virtual int Id { get; set; } 
    public virtual int Name{ get; set; } 
    public virtual Status { get; set; } 
} 
public class Status 
{ 
    public virtual int Id { get; set; } 
    public virtual int Text{ get; set; } 
} 
</div></pre>
<p>Map:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit6573' value='Select Code' data-codeid='sfcode6573' /></p><div class='sfcode' id='sfcode6573'>public class PersonMap : ClassMap&#60;Person&#62; 
{ 
    public PersonMap() 
    { 
        Id(t =&#62; t.Id); 
        Map(t =&#62; t.Name); 
        References(t =&#62; t.Status, "StatusID); 
    } 
} 
</div></pre>
<p>ViewModel:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit2616' value='Select Code' data-codeid='sfcode2616' /></p><div class='sfcode' id='sfcode2616'>public class PersonViewModel 
{ 
    public JQGrid PersonGrid { get; set; } 
    int Id { get; set; } 
    public virtual Status { get; set; } 
    public string Name { get; set; } 
 
    public PersonViewModel() 
    { 
        PersonGrid = new JQGrid 
        { 
            Columns = new List&#60;JQGridColumn&#62;()      
            {                           
                new JQGridColumn  
                { 
                    DataField = "Id", 
                    DataType = typeof(UInt32), 
                    HeaderText = "Id",      
                    PrimaryKey = true,     
                    Searchable = true, 
                }, 
                new JQGridColumn 
                {  
                    DataField = "Status", 
                    HeaderText = "Status",  
                    DataType = typeof(Status), 
                    Searchable = true, 
                }, 
                new JQGridColumn 
                {  
                    DataField = "Name", 
                    DataType = typeof(string), 
                    Searchable = true, 
                } 
            }, 
        }; 
        PersonGrid.ToolBarSettings.ShowSearchToolBar = true; 
    } 
} 
</div></pre>
<p>Controller:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit837' value='Select Code' data-codeid='sfcode837' /></p><div class='sfcode' id='sfcode837'>    public ActionResult Search() 
    {             
        var model = new PersonViewModel();      
        SetUpGrid(model);          
        return View(model);         
    } 
    public void SetUpGrid(PersonViewModel model) 
    {            
        var PersonGrid = model.PersonGrid;    
        PersonGrid.ID = "PersonGrid";      
        PersonGrid.DataUrl = Url.Action("PersonDataRequested");  
    }          
    public JsonResult PersonDataRequested()    
    { 
        var model = new PersonViewModel();       
        JQGridState gridState = model.PersonGrid.GetState(true); 
        Session["gridState"] = gridState; 
        return model.PersonGrid.DataBind(_session.Query&#60;Person&#62;());   
    }  
</div></pre>
<p>View:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit6782' value='Select Code' data-codeid='sfcode6782' /></p><div class='sfcode' id='sfcode6782'>@using Trirand.Web.Mvc 
@model ....PersonViewModel 
...standard script/header stuff... 
&#60;body&#62;     
  @Html.Trirand().JQGrid(Model.PersonGrid, "PersonGrid")  
&#60;/body&#62;     
</div></pre>
<p>The result I&#39;m getting is that "Castle.Proxies.StatusProxy" is being displayed in the status column for each person in the grid, and no search by status (neither Id nor Text value) returns any results. The searches by the Person fields (Id and Name) work just fine.</p>
]]></description>
        	        	<pubDate>Tue, 06 Dec 2011 15:47:32 +0200</pubDate>
        </item>
</channel>
</rss>