Jan 23, 2013, 3:37 PM
[CLOSED] Performing sort on GridPanel when it has text with underscore
Sorting GridPanel when it has underscore text does not work as expected, as shown below:
Initial GridPanel's state
GridPanel's state after sort (ascending)
Note that the texts that begins with "_" are below those others. As far as i know it should be above.
Initial GridPanel's state
GridPanel's state after sort (ascending)
Note that the texts that begins with "_" are below those others. As far as i know it should be above.
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:GridPanel Title="Ext.Net" runat="server" >
<Store>
<ext:Store runat="server" >
<Proxy>
<ext:AjaxProxy Url="/Example/LoadFakeRecords/">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader Root="data" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="Model2" runat="server">
<Fields>
<ext:ModelField Name="Name" SortType="AsUCText" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:RowNumbererColumn runat="server" />
<ext:Column Text="Name" DataIndex="Name" runat="server" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</body>
</html>
namespace SandBox.Controllers
{
public class ExampleController : System.Web.Mvc.Controller
{
public ActionResult Index()
{
return View();
}
public StoreResult LoadFakeRecords()
{
List<Entity> lst = new List<Entity>();
for (int index = 0; index < 15; index++)
{
lst.Add(new Entity
{
Name = index % 2 == 0 ? string.Format("Name{0}", index) : string.Format("_Name{0}", index),
});
}
return new StoreResult(lst, lst.Count());
}
}
public class Entity
{
public string Name { get; set; }
}
}
Last edited by Baidaly; Jan 24, 2013 at 1:08 AM.
Reason: [CLOSED]