PDA

View Full Version : [FIXED] [V0.8.0] Store Field SortType AsUCString doesn't work



jchau
Feb 05, 2009, 4:21 PM
 I have a grid hooked up to a store with a LastName field.  The field has SortType=AsUCString, but it is still doing a case sensitive sort.  The page source shows: 



Ext.data.JsonReader({fields:[{sortType:"AsUCString",name:"LastName"},{name:"FirstName"}]})




"AsUCString" on the clientside shouldn't have a capital "A"?

geoffrey.mcgill
Feb 05, 2009, 4:39 PM
Hi Jacky,

Good catch. We'll fix immediately. 

geoffrey.mcgill
Feb 05, 2009, 5:02 PM
Hi Jacky,

Ok, this should be fixed now. I added a new "ToCamelCaseConverter" to properly render that property in the configuration script. 


Thanks again for pointing out the problem. 

jchau
Feb 05, 2009, 5:06 PM
Awesome, thanks!

jchau
Apr 14, 2009, 5:45 PM
hmm...this still doesn't seem to work.  I see that the javascript outputs  SortType="asUCString" correctly.  Is it because I am using JsonReader?

Vladimir
Apr 15, 2009, 7:10 AM
Hi,

What problems do you have? asUCString is default sort type if Type="String". If set explicitly SortType="AsUCString" then it works also. Here is my test case



<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic"%>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
var data = new List<object>
{
new {Common="B"},
new {Common="C"},
new {Common="A"},
new {Common="b"},
new {Common="c"},
new {Common="a"}
};
Store1.DataSource = data;
Store1.DataBind();
}
</script>
</head>
<body>
<ext:ScriptManager ID="ScriptManager1" runat="server" StateProvider="None" />

<ext:Store runat="server" ID="Store1" AutoLoad="true">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Common" SortType="AsUCString" />
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="Common" Direction="ASC" />
</ext:Store>

<ext:Window ID="Window1"
runat="server"
Title="Window"
Height="500"
Width="500">
<Body>
<ext:FitLayout ID="FitLayout1" runat="server">
<ext:GridPanel
ID="GridPanel1"
runat="server"
AutoExpandColumn="Common"
Title="Plants"
Frame="false"
StoreID="Store1">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="Common" Header="Common Name" DataIndex="Common" Sortable="true" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</ext:FitLayout>
</Body>
</ext:Window>
</body>
</html>

jchau
Apr 15, 2009, 11:54 AM
Add a pager to your example, and sorting will no longer be case insensitive.





<BottomBar>
<ext:PagingToolbar ID="PagingToolBar1" runat="server" StoreID="store1" PageSize="25">
</ext:PagingToolbar>
</BottomBar>

Vladimir
Apr 15, 2009, 12:44 PM
Hi,

Fixed. Please update