[CLOSED] Local datastore filtering param when getting data to combo in local mode

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Local datastore filtering param when getting data to combo in local mode

    Hi,

    I would like to query a local datastore in a combo, with a "hidden" parameter.

    If you take this very much simplified example below:

    Before the combo is populated, i would like to pass a "TypeID=1" filter parameter, so the combo is only populated with the first 3 records, without having to repopulate the datastore.

    Can you help me in the right direction?

    <%@ Page Language="VB" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server" >
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            If Not Ext.Net.X.IsAjaxRequest Then
                Dim l As New List(Of FooData)
                l.Add(New FooData(1, 1, "Record 1"))
                l.Add(New FooData(2, 1, "Record 2"))
                l.Add(New FooData(3, 1, "Record 3"))
                l.Add(New FooData(4, 20, "Record 4"))
                l.Add(New FooData(5, 20, "Record 5"))
                l.Add(New FooData(6, 20, "Record 6"))
                Me.Store1.DataSource = l
                Me.Store1.DataBind()
            End If
        End Sub
        Public Class FooData
            Public ID As Integer
            Public TypeID As String
            Public Name As String
            Public Sub New(ByVal ID As Integer, ByVal TypeID As Integer, ByVal Name As String)
                Me.ID = ID
                Me.TypeID = TypeID
                Me.Name = Name
            End Sub
        End Class
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">
            <title></title>
        </head>
        <body>
            <form id="form1" runat="server">
                <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" />
                <script type="text/javascript">
                  
                </script>
                <div>
                    <ext:Store ID="Store1" runat="server" SerializationMode="Complex">
                        <Reader>
                            <ext:JsonReader IDProperty="ID">
                                <Fields>
                                    <ext:RecordField Name="ID" Type="Int" />
                                    <ext:RecordField Name="Name" />
                                    <ext:RecordField Name="TypeID" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                    <ext:GridPanel runat="server" 
                                   ID="GridPanel1"
                                   Height="300"
                                   StripeRows="true"
                                   StoreID="Store1">
                        <ColumnModel runat="server">
                            <Columns>
                                <ext:Column ColumnID="TypeID" DataIndex="TypeID" Sortable="true" Header="TypeID" Width="75">
                                    <Editor>
                                        <ext:ComboBox ID="AssetTypeCombo" runat="server" 
                                                      Mode="Local" 
                                                      TriggerAction="All" 
                                                      StoreID="Store1" 
                                                      ValueField="ID"
                                                      DisplayField="Name">
                                        </ext:ComboBox>
                                    </Editor>
                                </ext:Column>
                                <ext:Column ColumnID="ID" DataIndex="ID" Header="ID" />
                                <ext:Column ColumnID="Name" DataIndex="Name" Header="Name" />
                            </Columns>
                        </ColumnModel>
                    </ext:GridPanel>
                </div>
            </form>
        </body>
    </html>
    Last edited by Daniil; Nov 11, 2010 at 11:57 AM. Reason: [CLOSED]

Similar Threads

  1. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  2. Replies: 0
    Last Post: Aug 16, 2010, 10:28 PM
  3. [CLOSED] [1.0] Gridview local data paging with remote data
    By BerndDA in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 15, 2010, 10:29 AM
  4. Replies: 0
    Last Post: May 11, 2010, 10:35 PM
  5. remote and local filtering
    By marcmvc in forum 1.x Help
    Replies: 0
    Last Post: Oct 13, 2009, 12:38 PM

Tags for this Thread

Posting Permissions