ASP.net:ext.net gridpanel过滤日期不起作用

时间:2014-08-11 08:51:16

标签: asp.net vb.net ext.net gridpanel

看这个代码
                                                                                                                                                                                                                                                                   

                <Model>
                    <ext:Model ID="Model1" runat="server" IDProperty="DownTimeSequenceNo">
                        <Fields>
                            <ext:ModelField Name="RowNumber" />
                            <ext:ModelField Name="DownTimeSequenceNo" />
                            <ext:ModelField Name="Status" Type="String"  />
                            <ext:ModelField Name="Keterangan"  />
                            <ext:ModelField Name="DownTimeDate" Type="Date" />
                            <ext:ModelField Name="WSID" Type="String" />
                             </Fields>
                    </ext:Model>
                </Model>
                <Sorters>
                    <ext:DataSorter Property="DownTimeSequenceNo" Direction="ASC" />
                </Sorters>
            </ext:Store>
        </Store>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column ID="Column1" runat="server" Text="No" DataIndex="RowNumber" Sortable="False"
                    Width="50" Filterable="false" />
                <ext:Column ID="Column2" runat="server" Text="DownTimeSequenceNo" DataIndex="DownTimeSequenceNo"
                    Visible="false" />
                <ext:Column ID="Column3" runat="server" Text="Status" DataIndex="Status" Width="50" />
                <ext:Column ID="Column4" runat="server" Text="Keterangan" DataIndex="Keterangan"
                    Width="100" Filterable="false" Sortable="False" />
                <ext:DateColumn ID="Column5" runat="server" Text="Tanggal" DataIndex="DownTimeDate"
                    Width="80" Format="dd/MMM/Y HH:mm" Filterable="true" />
                <ext:Column ID="Column6" runat="server" Text="WSID" DataIndex="WSID" Width="50" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi" />
        </SelectionModel>
        <Plugins>
            <ext:FilterHeader ID="FilterHeader1" runat="server" Remote="true"   />
        </Plugins>
    </ext:GridPanel>
</asp:Panel>

如果过滤器数据类型是字符串,则此代码会进行过滤,但在日期时它不起作用。我该怎么办 ? 我试图谷歌和ext-net示例没有提供任何帮助。

1 个答案:

答案 0 :(得分:0)

看一下这个官方的例子

here

你需要声明功能并在此处指定日期

<Features>
                        <ext:GridFilters ID="GridFilters1" runat="server">
                            <Filters>
                                <ext:NumericFilter DataIndex="Id" />
                                <ext:StringFilter DataIndex="Company" />
                                <ext:NumericFilter DataIndex="Price" />
                                <ext:DateFilter DataIndex="Date">
                                    <DatePickerOptions runat="server" TodayText="Now" />
                                </ext:DateFilter>
                                <ext:ListFilter DataIndex="Size" Options="extra small,small,medium,large,extra large" />
                                <ext:BooleanFilter DataIndex="Visible" />
                            </Filters>
                        </ext:GridFilters>
                    </Features>