[FIXED] [#289] [2.x] default Sort Direction doesn't work?
Hi, in my ModelField config, I stated that the SortDir="DESC". But it doesn't seem to sort descendingly on first click. Also, if I supplied a DefaultValue config to the ModelField (e.g., DefaultValue="Test'), javascript errors occur.
Code:
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim list As New List(Of Object)
For index = 1 To 25
list.Add(New With {.Id = index, .Name = "Name " + index.ToString(), .Description = "Description " + index.ToString(), .Grouping = "Group 1"})
Next
For index = 26 To 50
list.Add(New With {.Id = index, .Name = "Name " + index.ToString(), .Description = "Description " + index.ToString(), .Grouping = "Group 2"})
Next
Me.Store1.DataSource = list
Me.Store1.DataBind()
End Sub
</script>
<html>
<head id="Head1" runat="server">
</head>
<body>
<form runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button1" runat="server" Text="Show Window" Icon="Application">
<Listeners>
<Click Handler="#{Window1}.show(this);" />
</Listeners>
</ext:Button>
<ext:Window ID="Window1" runat="server" Hidden="false" Maximizable="true" Width="500"
Height="500">
<LayoutConfig>
<ext:FitLayoutConfig>
</ext:FitLayoutConfig>
</LayoutConfig>
<Items>
<ext:GridPanel runat="server" Title="Restaurants" Frame="true">
<Store>
<ext:Store runat="server" ID="Store1">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Id" SortDir="ASC"/>
<ext:ModelField Name="Name" SortDir="DESC" />
<ext:ModelField Name="description" />
<ext:ModelField Name="rating" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Id" Flex="1" DataIndex="Id" />
<ext:Column runat="server" Text="Name" Flex="1" DataIndex="Name" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</Items>
</ext:Window>
</form>
</body>
</html>