http://examples.ext.net/#/GridPanel/Paging_and_Sorting/XML_WebService/ 我只是在这个例子中添加了一个 ext:GridFilters 。这就是全部。我用 ext:GridFilters 测试了这个例子,但没有给我过滤的数据。
这是aspx代码;
<html>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:GridPanel
runat="server"
ID="GridPanel1"
Title="Employees"
Frame="true"
Height="300">
<Store>
<ext:Store
ID="Store1"
runat="server"
RemoteSort="true"
RemoteFilter="true"
AutoSync="false" RemotePaging="true"
PageSize="5">
<Proxy>
<ext:AjaxProxy Url="WebService1.asmx/PlantsPaging">
<ActionMethods Read="GET" />
<Reader>
<ext:XmlReader Record="Plant" TotalProperty="TotalRecords" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Parameters>
<ext:StoreParameter Name="filter" Value="" Mode="Value" />
</Parameters>
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Common" />
<ext:ModelField Name="Botanical" />
<ext:ModelField Name="Light" />
<ext:ModelField Name="Price" Type="Float" />
<ext:ModelField Name="Availability" Type="Date" />
<ext:ModelField Name="Indoor" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
<Sorters>
<ext:DataSorter Property="Common" Direction="ASC" />
</Sorters>
</ext:Store>
</Store>
<Features>
<ext:GridFilters ID="GridFilters1" runat="server" Local="false" >
<Filters>
<ext:StringFilter DataIndex="Common" />
<ext:StringFilter DataIndex="Botanical" />
</Filters>
</ext:GridFilters>
</Features>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Common Name" DataIndex="Common" Sortable="true" Flex="1" />
<ext:Column ID="Column2" runat="server" Text="Botanical" DataIndex="Botanical" Width="230" />
<ext:Column ID="Column3" runat="server" Text="Light" DataIndex="Light" Width="130" />
<ext:Column ID="Column4" runat="server" Text="Price" DataIndex="Price" Width="70" Align="right" />
<ext:DateColumn ID="DateColumn1" runat="server" Text="Available" DataIndex="Availability" Width="95" Format="yyyy-MM-dd" />
<ext:Column ID="Column5" runat="server" Text="Indoor?" DataIndex="Indoor" Width="55" />
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView1" runat="server" LoadingText="Loading XML..." />
</View>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1"
runat="server"
DisplayInfo="true"
DisplayMsg="Displaying plants {0} - {1} of {2}"
EmptyMsg="No plants to display"
/>
</BottomBar>
</ext:GridPanel>
</form>
</body>
</html>
我在网络服务上调用这个方法,
public Paging<Plant> PlantsPaging(int start, int limit, string sort, string filter)
{
}
但过滤器变空。