Jan 23, 2014, 11:41 AM
[CLOSED] GridPanel JavaScript Filter with Paging Problem
Hello
I used JavaScript function for filtering the gridpanel.I am calling the js function from listener of a button..
Here is the my javascript function
But when i click the next page button(gridpagingtoolbar), filter is flying :)
Here is my grid panel.
Thank you...
I used JavaScript function for filtering the gridpanel.I am calling the js function from listener of a button..
Here is the my javascript function
function filterNotificationStore() {
var grid = App.AllNotificationsGridPanel;
var idList = new Array();
idList.push(40);
idList.push(45);
idList.push(47);
var filterFn = function (item) {
if (idList.indexOf(item.data.UserID) > -1) {
return true;
}
else {
return false;
}
};
grid.store.filterBy(filterFn);
}
It works and filtering well. But when i click the next page button(gridpagingtoolbar), filter is flying :)
Here is my grid panel.
<ext:GridPanel ID="AllNotificationsGridPanel" runat="server" Cls="feed-grid" Border="true">
<Features>
<ext:GridFilters runat="server" ID="NotificationGridFilter" Local="true">
<Filters>
<ext:DateFilter DataIndex="ActivityDate">
</ext:DateFilter>
</Filters>
</ext:GridFilters>
</Features>
<Store>
<ext:Store ID="NotificationsStore" runat="server">
<Model>
<ext:Model ID="NotificationsModel" runat="server" Name="NotificationItem" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="Int"/>
<ext:ModelField Name="UserID" Type="Int"/>
<ext:ModelField Name="Title" Type="String"/>
<ext:ModelField Name="ActivityDate" Type="Date"/>
<ext:ModelField Name="ActivityBy" Type="String" />
<ext:ModelField Name="MsgContent" Type="String" />
<ext:ModelField Name="Unread" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
<Sorters>
<ext:DataSorter Property="ActivityDate" Direction="DESC" />
</Sorters>
</ext:Store>
</Store>
<View>
<ext:GridView ID="GridView1" runat="server">
<Listeners>
<ItemDblClick Handler="ActivityViewer.ActivityInfo.activityTabOpen(record);" />
</Listeners>
</ext:GridView>
</View>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single">
<DirectEvents>
<Select OnEvent="ActivitySelect" Buffer="250" Before="return record.data.Unread;" Success="activityRowSelectSuccess(record);">
<ExtraParams>
<ext:Parameter Name="ID" Value="record.data.ID" Mode="Raw" />
</ExtraParams>
</Select>
</DirectEvents>
</ext:RowSelectionModel>
</SelectionModel>
<ColumnModel>
<Columns>
<ext:Column ID="Column1" runat="server" Text="Title" DataIndex="Title" Flex="1">
<Renderer Handler="return notificationRenderHandler(value,record);" />
</ext:Column>
<ext:Column ID="Column3" runat="server" Text="Date" DataIndex="ActivityDate" Width="150">
<Renderer Handler="return formatDate(value, record, metadata)" />
</ext:Column>
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" />
</BottomBar>
</ext:GridPanel>
How can i solve this problem ?Thank you...
Last edited by Daniil; Jan 31, 2014 at 5:52 AM.
Reason: [CLOSED]