Nov 10, 2010, 7:43 PM
[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?
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]