Oct 11, 2012, 4:35 AM
DropdownField with a Gridpanel revisited
Ext.net.dll version: 1.2.0.21945
Framework: 4.0
Language: VB
Context: Ext.NET Desktop
http://forums.ext.net/showthread.php...-dropdown-list
In the thread link above a question was asked: Can you provide more details why DropDownField is not an option for you?
Keep in mind this is all within the Desktop/Desktop-Windows model.
From our experience when a Gridpanel is placed inside the component collection of a DropDownField we run into some challenges.
Follow this steps to reproduce the issue
1. Click on Desktop icon to launch Desktop Window.
2. Assume a Gridpanel with a self-contained Store already has data successfully bound. And this gridpanel is within the component collection of a DropdownField.
3. Click on DropdownField. (Gridpanel shows properly with paging, sorting, rowselect (directevent) all working).
4. Click a row on the Gridpanel so it's highlighted.
5. Close Desktop Window.
6. Click on a different Desktop Icon to open a different Desktop Window.
7. Close Desktop Window that you just opened.
8. Reopen the original Desktop Window
At this point the DropdownField will no longer dropdown.
We also did try to rebind the same data to the Store when the original Desktop Window was reactived via the Activate Event (DirectEvent), we didn't get any errors when trying to rebind, but the dropdownfield still wouldn't drop.
There's also an issue where, if you select a row on the girdpanel which fires the DirectEvents RowSelect, afterwards we couldn't successfully unselect the row client-side or server-side. It's an issue because the next time you choose the dropdownfield and click the same row on the gridpanel the RowSelect will not fire because it's already selected.
We did notice some older threads where you guys did discuss setting LazyMode="Instance", but there's some confusion about if subsequent controls within needed LazyMode="Config". We saw some discussion about IE7 and repaint. Not sure if that applies to later browsers or not.
Anyway in short, a gridpanel in a dropdownfield does have some issues that we have not be able to resolve. Some help on this would be much appreciated.
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack And Not IsCallback Then
BindStore1()
End If
End Sub
Private Sub BindStore1()
Try
Dim anonList As New List(Of Object)
For i As Int32 = 0 To 100
anonList.Add(New With {.Id = i, .Last = "Last Name", .First = "First Name", .Number = "---", .Number2 = "---", .Type = "---", .Anon1 = "---", .Anon2 = "---"})
Next
Store2.DataSource = anonList
Store2.DataBind()
Catch ex As Exception
Throw ex
End Try
End Sub
</script>
<ext:DropDownField ID="ddf1" runat="server" Mode="ValueText" LabelStyle="width:105px;"
FieldLabel="Teachers" Width="250" AllowBlank="true">
<Component>
<ext:GridPanel ID="gpTeachers2" AutoDataBind="false" runat="server" Height="350"
Width="500" LazyMode="Instance">
<Store>
<ext:Store ID="Store2" runat="server" AutoDataBind="false" AutoLoad="false"
ShowWarningOnFailure="false">
<Reader>
<ext:JsonReader IDProperty="Id" AutoDataBind="false">
<Fields>
<ext:RecordField AllowBlank="false" Name="Id" Mapping="Id" Type="Int">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Last" Mapping="Last" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="First" Mapping="First" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Number" Mapping="Number" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Number2" Mapping="Number2"
Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Type" Mapping="Type" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Anon1" Mapping="Anon1" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Anon2" Mapping="Anon2" Type="String">
</ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="13" Mode="Raw" />
</AutoLoadParams>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel4" runat="server">
<Columns>
<ext:Column ColumnID="Id" DataIndex="Id" Header="Id" Hidden="true">
</ext:Column>
<ext:Column ColumnID="Last" DataIndex="Last" Header="Last">
</ext:Column>
<ext:Column ColumnID="First" DataIndex="First" Header="First">
</ext:Column>
<ext:Column ColumnID="Number" DataIndex="Number" Header="Number">
</ext:Column>
<ext:Column ColumnID="Number2" DataIndex="Number2" Header="Number2">
</ext:Column>
<ext:Column ColumnID="Type" DataIndex="Type" Header="Type" Width="175">
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel3" runat="server" AutoDataBind="false"
SingleSelect="true" MoveEditorOnEnter="false">
<DirectEvents>
<RowSelect OnEvent="rsm2_RowSelect" Delay="1" Buffer="250">
<ExtraParams>
<ext:Parameter Name="pId" Value="record.data.Id" Mode="Raw" Encode="true" />
<ext:Parameter Name="pNumber" Value="record.data.Number" Mode="Raw" Encode="true" />
<ext:Parameter Name="pLastName" Value="record.data.Last" Mode="Raw" Encode="true" />
<ext:Parameter Name="pFirstName" Value="record.data.First" Mode="Raw" Encode="true" />
</ExtraParams>
</RowSelect>
</DirectEvents>
</ext:RowSelectionModel>
</SelectionModel>
<Plugins>
<ext:GridFilters runat="server" ID="GridFilters2" Local="true">
<Filters>
<ext:StringFilter DataIndex="Last" />
<ext:StringFilter DataIndex="First" />
<ext:StringFilter DataIndex="Number" />
<ext:StringFilter DataIndex="Number2" />
<ext:StringFilter DataIndex="Type" />
</Filters>
</ext:GridFilters>
</Plugins>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar2" runat="server" StoreID="Store2" PageSize="13">
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>
</Component>
</ext:DropDownField>
Framework: 4.0
Language: VB
Context: Ext.NET Desktop
http://forums.ext.net/showthread.php...-dropdown-list
In the thread link above a question was asked: Can you provide more details why DropDownField is not an option for you?
Keep in mind this is all within the Desktop/Desktop-Windows model.
From our experience when a Gridpanel is placed inside the component collection of a DropDownField we run into some challenges.
Follow this steps to reproduce the issue
1. Click on Desktop icon to launch Desktop Window.
2. Assume a Gridpanel with a self-contained Store already has data successfully bound. And this gridpanel is within the component collection of a DropdownField.
3. Click on DropdownField. (Gridpanel shows properly with paging, sorting, rowselect (directevent) all working).
4. Click a row on the Gridpanel so it's highlighted.
5. Close Desktop Window.
6. Click on a different Desktop Icon to open a different Desktop Window.
7. Close Desktop Window that you just opened.
8. Reopen the original Desktop Window
At this point the DropdownField will no longer dropdown.
We also did try to rebind the same data to the Store when the original Desktop Window was reactived via the Activate Event (DirectEvent), we didn't get any errors when trying to rebind, but the dropdownfield still wouldn't drop.
There's also an issue where, if you select a row on the girdpanel which fires the DirectEvents RowSelect, afterwards we couldn't successfully unselect the row client-side or server-side. It's an issue because the next time you choose the dropdownfield and click the same row on the gridpanel the RowSelect will not fire because it's already selected.
We did notice some older threads where you guys did discuss setting LazyMode="Instance", but there's some confusion about if subsequent controls within needed LazyMode="Config". We saw some discussion about IE7 and repaint. Not sure if that applies to later browsers or not.
Anyway in short, a gridpanel in a dropdownfield does have some issues that we have not be able to resolve. Some help on this would be much appreciated.
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack And Not IsCallback Then
BindStore1()
End If
End Sub
Private Sub BindStore1()
Try
Dim anonList As New List(Of Object)
For i As Int32 = 0 To 100
anonList.Add(New With {.Id = i, .Last = "Last Name", .First = "First Name", .Number = "---", .Number2 = "---", .Type = "---", .Anon1 = "---", .Anon2 = "---"})
Next
Store2.DataSource = anonList
Store2.DataBind()
Catch ex As Exception
Throw ex
End Try
End Sub
</script>
<ext:DropDownField ID="ddf1" runat="server" Mode="ValueText" LabelStyle="width:105px;"
FieldLabel="Teachers" Width="250" AllowBlank="true">
<Component>
<ext:GridPanel ID="gpTeachers2" AutoDataBind="false" runat="server" Height="350"
Width="500" LazyMode="Instance">
<Store>
<ext:Store ID="Store2" runat="server" AutoDataBind="false" AutoLoad="false"
ShowWarningOnFailure="false">
<Reader>
<ext:JsonReader IDProperty="Id" AutoDataBind="false">
<Fields>
<ext:RecordField AllowBlank="false" Name="Id" Mapping="Id" Type="Int">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Last" Mapping="Last" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="First" Mapping="First" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Number" Mapping="Number" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Number2" Mapping="Number2"
Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Type" Mapping="Type" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Anon1" Mapping="Anon1" Type="String">
</ext:RecordField>
<ext:RecordField AllowBlank="true" Name="Anon2" Mapping="Anon2" Type="String">
</ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="13" Mode="Raw" />
</AutoLoadParams>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel4" runat="server">
<Columns>
<ext:Column ColumnID="Id" DataIndex="Id" Header="Id" Hidden="true">
</ext:Column>
<ext:Column ColumnID="Last" DataIndex="Last" Header="Last">
</ext:Column>
<ext:Column ColumnID="First" DataIndex="First" Header="First">
</ext:Column>
<ext:Column ColumnID="Number" DataIndex="Number" Header="Number">
</ext:Column>
<ext:Column ColumnID="Number2" DataIndex="Number2" Header="Number2">
</ext:Column>
<ext:Column ColumnID="Type" DataIndex="Type" Header="Type" Width="175">
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel3" runat="server" AutoDataBind="false"
SingleSelect="true" MoveEditorOnEnter="false">
<DirectEvents>
<RowSelect OnEvent="rsm2_RowSelect" Delay="1" Buffer="250">
<ExtraParams>
<ext:Parameter Name="pId" Value="record.data.Id" Mode="Raw" Encode="true" />
<ext:Parameter Name="pNumber" Value="record.data.Number" Mode="Raw" Encode="true" />
<ext:Parameter Name="pLastName" Value="record.data.Last" Mode="Raw" Encode="true" />
<ext:Parameter Name="pFirstName" Value="record.data.First" Mode="Raw" Encode="true" />
</ExtraParams>
</RowSelect>
</DirectEvents>
</ext:RowSelectionModel>
</SelectionModel>
<Plugins>
<ext:GridFilters runat="server" ID="GridFilters2" Local="true">
<Filters>
<ext:StringFilter DataIndex="Last" />
<ext:StringFilter DataIndex="First" />
<ext:StringFilter DataIndex="Number" />
<ext:StringFilter DataIndex="Number2" />
<ext:StringFilter DataIndex="Type" />
</Filters>
</ext:GridFilters>
</Plugins>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar2" runat="server" StoreID="Store2" PageSize="13">
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>
</Component>
</ext:DropDownField>