Oct 26, 2011, 10:19 PM
Paging in Live Search Combo...
Hi there.
Now the code filters fine, but I have problems with the paging. I had this line:
I espect see the first 2 records in the page 1 and the last ones in the page 2.
Am I missing something?
The page code is:
Now the code filters fine, but I have problems with the paging. I had this line:
PageSize="10"
And changed to:PageSize="2"
And when I do a search than returns me 4 registers, it show 4 regs in the page 1 and the same 4 regs in the page 2.I espect see the first 2 records in the page 1 and the last ones in the page 2.
Am I missing something?
The page code is:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="LiveSearch_City.ascx.vb" Inherits="UserControl_LiveSearch_City" %>
<%--Control de usuario que realiza un LiveSearch--%>
<%--Tomado del ejemplo de la página: [https://examples1.ext.net/#/Form/ComboBox/Custom_Search/]--%>
<link href="../../Common/css/ExtNet/LiveSearch.css" rel="stylesheet" type="text/css" />
<ext:Store
ID="Store_ddlCity"
runat="server"
AutoLoad="false">
<Proxy>
<ext:HttpProxy Method="POST" Url="LiveSearch_City.ashx" />
</Proxy>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="iIdCity" />
<ext:RecordField Name="sCity" />
<ext:RecordField Name="sState" />
<ext:RecordField Name="sCountry" />
<ext:RecordField Name="sCityFull" />
<ext:RecordField Name="sCityCode" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<%--Properties--%>
<%--FieldLabel, LoadingText, Width--%>
<ext:ComboBox ID="ddlCity"
runat="server"
DisplayField="sCityFull"
ValueField="iIdCity"
StoreID="Store_ddlCity"
TypeAhead="false"
LoadingText="NoText"
PageSize="2"
HideTrigger="true"
ItemSelector="div"
MinChars="3"
FieldLabel="NoText">
<Template ID="Template1" runat="server">
<Html>
<tpl for=".">
<div class="live-search">
<h3>({sCityCode}) {sCity}</h3>
{sState}, {sCountry}
</div>
</tpl>
</Html>
</Template>
</ext:ComboBox>
The proxu code is:<%@ WebHandler Language="VB" Class="LiveSearch_City" %>
Imports System
Imports System.Web
Imports Ext.Net
Public Class LiveSearch_City : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "text/json"
Dim oDataObject As New Gravitar.Neptune.BLL.Admin.City
Dim dt As DataTable
oDataObject.sCity = context.Request("query").ToString
dt = oDataObject.ListLike
context.Response.Write(JSON.Serialize(dt))
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
Thanks in advance.