PDA

View Full Version : [CLOSED] How To Filtering Time In GridPanel ?



yuda236
Dec 30, 2013, 7:18 AM
Hi Guys,

I Have Problem About Grid Filtering Time In GridPanel This The Sample Code And Screenshoot(in Attachment) .



<ext:GridPanel
ID="GPDetail1"
runat="server"
Title="Listing"
AutoScroll="true"
MaxHeight="300">
<Store>
<ext:Store ID="Store2" runat="server" OnReadData="Store1_RefreshData" PageSize="30">
<Model>
<ext:Model ID="Model2" runat="server" Name="Person" IDProperty="ID" >
<Fields>
<ext:ModelField Name="ID" Type="Int"/>
<ext:ModelField Name="Bulan" Type="Int" />
<ext:ModelField Name="DateStart" Type="Date" />
<ext:ModelField Name="DateEnd" Type="Date" />
<ext:ModelField Name="TimeIn" />
<ext:ModelField Name="TimeOut" />
<ext:ModelField Name="MinuteRest" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server" ID="ColumnModel2" >
<Columns>
<ext:RowNumbererColumn ID="RowNumbererColumn2" runat="server" />
<ext:Column ID="DateColumn1" runat="server" DataIndex="Bulan" Text="Month" Width="200" Flex="1" />
<ext:DateColumn Format="dd-MM-yyyy" ID="Column10" runat="server" DataIndex="DateStart" Text="Date Start" Width="200" Flex="1" />
<ext:DateColumn Format="dd-MM-yyyy" ID="Column30" runat="server" DataIndex="DateEnd" Text="Date End" Width="200" Flex="1" />
<ext:Column ID="DateColumn2" runat="server" DataIndex="TimeIn" Text="Time In" Width="200" Flex="1" />
<ext:Column ID="DateColumn3" runat="server" DataIndex="TimeOut" Text="Time Out" Width="200" Flex="1" />
<ext:Column ID="Column1" runat="server" DataIndex="MinuteRest" Text="Minute Rest" Width="200" Flex="1" />
</Columns>
</ColumnModel>
<Features>
<ext:GroupingSummary ID="GroupingSummary2" runat="server" GroupHeaderTplString="{name}" >
</ext:GroupingSummary>
<ext:GridFilters ID="GridFilters1" runat="server" Local="true">
<Filters>
<ext:NumericFilter DataIndex="Bulan" />
<ext:DateFilter DataIndex="DateStart" />
<ext:DateFilter DataIndex="DateEnd" />
<ext:BooleanFilter DataIndex="IsHoliday" />
</Filters>
</ext:GridFilters>
</Features>
<TopBar>
<ext:Toolbar runat="server" ID="toolbar2" >
<Items>
<ext:Button Padding="5" Icon="Script" runat="server" ID="btnAutoGenerate" Text="AutoGenerate" >
<DirectEvents>
<Click OnEvent="btnAutoGenerate_Click" />
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="Button15" Text="Data Management" Icon="Database">
<Menu>
<ext:Menu ID="Menu4" runat="server">
<Items>
<ext:Button ID="Button16" runat="server" Text="Add Data" Icon="NoteAdd">
<DirectEvents>
<Click OnEvent="btnAddDetail_Click">
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="Button17" runat="server" Text="Edit Data" Icon="NoteEdit">
<DirectEvents>
<Click OnEvent="btnEditDetail_Click">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GPDetail1}.getRowsValues({selectedOnl y:true}))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="Button18" runat="server" Text="Delete Data" Icon="NoteDelete">
<DirectEvents>
<Click OnEvent ="btnDeleteDetail_Click">
<Confirmation Title="Konfirmasi" Message="Apakah Anda yakin Akan Menghapus Item Tersebut ?" ConfirmRequest="true" />
<EventMask ShowMask="true" Msg="Processing...." />
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GPDetail1}.getRowsValues({selectedOnl y:true}))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar2" runat="server">
<Items>
<ext:Label ID="Label2" runat="server" Text="Page size:" />
<ext:ToolbarSpacer ID="ToolbarSpacer2" runat="server" Width="10" />
<ext:ComboBox ID="ComboBox2" runat="server" Width="80">
<Items>
<ext:ListItem Text="1" />
<ext:ListItem Text="2" />
<ext:ListItem Text="10" />
<ext:ListItem Text="20" />
</Items>
<SelectedItems>
<ext:ListItem Value="10" />
</SelectedItems>
<Listeners>
<Select Handler="#{GPDetail1}.store.pageSize = parseInt(this.getValue(), 10); #{GPDetail1}.store.reload();" />
</Listeners>
</ext:ComboBox>
</Items>
<Plugins>
<ext:ProgressBarPager ID="ProgressBarPager2" runat="server" />
</Plugins>
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>

7430

how can i filter time in grid ?

i want filter like date (range).

Thx

Yuda

Daniil
Dec 30, 2013, 11:56 AM
Hi @yuda236,

Unfortunately, there is no ready solution for time filtration. At least, we have never seen yet.

I can recommend you to implement a custom control by analogy with DateFilter.