Paging in Live Search Combo...

  1. #1

    Paging in Live Search Combo...

    Hi there.

    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.
  2. #2
    Hi,

    Well, if you need local paging please set up RemotePaging="false" for a Store.
  3. #3
    Thanks!
    That solved the problem.

Similar Threads

  1. Live search
    By Vaishali in forum 1.x Help
    Replies: 3
    Last Post: Apr 03, 2012, 5:31 AM
  2. Live search
    By Yannis in forum 1.x Help
    Replies: 3
    Last Post: Jan 14, 2010, 12:22 AM
  3. Combobox live search
    By Yannis in forum 1.x Help
    Replies: 0
    Last Post: Dec 09, 2009, 10:19 AM
  4. live search
    By olimpia in forum 1.x Help
    Replies: 0
    Last Post: Jun 29, 2009, 5:44 PM
  5. "Live Search" sql example
    By jmilton in forum 1.x Help
    Replies: 4
    Last Post: Apr 06, 2009, 12:14 PM

Posting Permissions