Sep 19, 2012, 2:18 PM
[CLOSED] Paging Issue
Hi,
I am not yet upgraded to Ext.Net2.0. I am posted this issue in 2.x Premium Help.
Paging Issue.
Actually we have already developed one approach to get Data as in following code. While adding records to datatable we will verify some conditions and then modify that record to show properly GUI. Example if column value 2 it should show as II, or ii or two. This is just an example, in this way I have to modify the data in each column and then add to data column to show in the grid.
Please help me out how can I implement the paging to show first set (page size) of records quickly.
I am not yet upgraded to Ext.Net2.0. I am posted this issue in 2.x Premium Help.
Paging Issue.
Actually we have already developed one approach to get Data as in following code. While adding records to datatable we will verify some conditions and then modify that record to show properly GUI. Example if column value 2 it should show as II, or ii or two. This is just an example, in this way I have to modify the data in each column and then add to data column to show in the grid.
Please help me out how can I implement the paging to show first set (page size) of records quickly.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ExtPagingCheck.aspx.vb"
Inherits="Testing_ExtPagingCheck" %>
<%@ 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">
<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" />
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader IDProperty="RECORD_ID">
<Fields>
<ext:RecordField Name="RECORD_ID" />
<ext:RecordField Name="NAME" />
<ext:RecordField Name="Value1" />
<ext:RecordField Name="Value2" />
<ext:RecordField Name="PresentDate" />
</Fields>
</ext:JsonReader>
</Reader>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="25" Mode="Raw" />
</AutoLoadParams>
</ext:Store>
<ext:Viewport ID="vpSearchDocuments" runat="server" Layout="border">
<Items>
<ext:GridPanel ID="gvReg" runat="server" StoreID="Store1" AnchorHorizontal="100%"
Region="Center" Title="Search Results" AutoExpandColumn="NAME" MaskDisabled="false"
StripeRows="true" Cls="horizontal-scrolling-fix">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column Header="App ID" DataIndex="RECORD_ID" Width="80">
</ext:Column>
<ext:Column Header="BorrowerType" DataIndex="NAME" />
<ext:Column Header="Condition Name" DataIndex="Value1" />
<ext:Column Header="Condition Info" DataIndex="Value2" />
<ext:Column Header="Uploaded Date" DataIndex="PresentDate" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
</SelectionModel>
<LoadMask ShowMask="true" />
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="25">
<Items>
<ext:Label ID="Label1" runat="server" Text="Page size:" />
<ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
<ext:ComboBox ID="ComboBox1" runat="server" Width="80">
<Items>
<ext:ListItem Text="5" />
<ext:ListItem Text="10" />
<ext:ListItem Text="25" />
<ext:ListItem Text="50" />
<ext:ListItem Text="100" />
<ext:ListItem Text="250" />
</Items>
<SelectedItem Value="25" />
<Listeners>
<Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
</Listeners>
</ext:ComboBox>
</Items>
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
Code behind...Imports Ext.Net
Partial Class Testing_ExtPagingCheck
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Ext.Net.X.IsAjaxRequest Then
Call LoadDataInfo()
End If
End Sub
Public Sub LoadDataInfo()
Store1.DataSource = GetDataSourceInfo()
Store1.DataBind()
End Sub
Public Function GetDataSourceInfo() As DataTable
Dim dt As New DataTable
Dim dr As DataRow
Dim i As Integer
Dim rnd As New Random
dt.Columns.Add("RECORD_ID")
dt.Columns.Add("NAME")
dt.Columns.Add("Value1")
dt.Columns.Add("Value2")
dt.Columns.Add("PresentDate")
For i = 0 To 60000
dr = dt.NewRow()
dr(0) = i + 1
dr(1) = "Name " & i
dr(2) = "Random Info " & rnd.Next(1, 20000)
dr(3) = "Random Info " & rnd.Next(20000, 40000)
dr(4) = System.DateTime.Now.Ticks()
dt.Rows.Add(dr)
Next
Return dt
End Function
End Class
Last edited by Daniil; Sep 25, 2012 at 6:46 AM.
Reason: [CLOSED]