[CLOSED] Paging issues with combobox

  1. #1

    [CLOSED] Paging issues with combobox

    Hi,

    I am trying to use the Two Column combobox with the paging facility. However, when the dropdown is clicked, I see all the records instead of just the first 10 (my pagesize). However, when I click the next page everything works fine and only 10 records render at a time. It is only the first time I click the dropdown that I have an issue.

    What could I be missing?

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SelectCustomerOnlyName.aspx.vb" Inherits="EXTTabs.SelectCustomerOnlyName" %>
    <%@ 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>
        <style type="text/css">
            .cbStates-list 
            {
                width: 298px;
                font: 11px tahoma,arial,helvetica,sans-serif;
            }
            
            .cbCustomers-list th {
                font-weight: bold;
            }
            
            .cbCustomers-list td, .cbCustomers-list th {
                padding: 3px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Store ID="Store1" runat="server" >
               
            <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="name" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>   
        </ext:Store>
        <ext:FormPanel ID="FormPanel1" runat="server" Height="400" Title="Form Panel" Padding="5"
            MonitorResize="true">
            <Items>
                <ext:ComboBox ID="cbCustomers" runat="server" EmptyText="Select Customer" TypeAhead="true"
                    ForceSelection="true" StoreID="Store1"  EnableKeyEvents="true" Mode="Local"  DisplayField="name"
                    ValueField="name" MinChars="1"     Width="600" ListWidth="600" PageSize="10" ItemSelector="tr.list-item">
                    <Template ID="Template1" runat="server">
                        <Html>
                            <tpl for=".">
                            <tpl if="[xindex] == 1">
                                <table class="cbCustomers-list">
                                    <tr>
                                        <th>Customer Name</th>
                                    </tr>
                            </tpl>
                            <tr class="list-item">
                                <td style="padding:3px 0px;">{name}</td>
                            </tr>
                            <tpl if="[xcount-xindex]==0">
                                </table>
                            </tpl>
                        </tpl>
                        </Html>
                    </Template>
                    <Triggers>
                        <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                    </Triggers>
                    <Listeners>
                        <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                        <TriggerClick Handler="if (index == 0) { this.focus().clearValue(); trigger.hide();}" />
                        <Select Handler="this.triggers[0].show();" />
                    </Listeners>
                </ext:ComboBox>
            </Items>
        </ext:FormPanel>
        </form>
    </body>
    </html>
    This is the code behind:

    <script runat="server">
    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            
            Dim customers As New DataSet
            Using dtCustomers As New DataTable()
                Using conn As New SqlConnection() With {.ConnectionString = CType(ConfigurationManager.AppSettings("ConnectionString"), String)}
                    Using cmd As New SqlCommand() With {.Connection = conn, .CommandType = CommandType.StoredProcedure, .CommandText = "GetCustomers"}
                        cmd.Parameters.Add("@Group", SqlDbType.VarChar).Value = "TestCusts"
                       
                        conn.Open()
    
                        If conn.State = ConnectionState.Open Then
                            Using adap As New SqlDataAdapter(cmd)
                                adap.Fill(customers)
                                Store1.DataSource = customers
                                Store1.DataBind()
                            End Using
                        End If
                    End Using
                End Using
            End Using
    
    
    
        End Sub
        </script>


    Thanks

    Ravi Swaminathan
    Last edited by Daniil; Jun 21, 2012 at 1:21 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Thanks for the report. It is also reproducible with our online example.
    https://examples1.ext.net/#/Form/ComboBox/Two_Columns/

    We will fix.

    To fix please add the following AutoLoadParams section for the Store.

    Example
    <ext:Store ID="Store1" runat="server">    
        <AutoLoadParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
        </AutoLoadParams>
    </ext:Store>
    P.S. You can place the code behind wrapped in
    <script runat="server">
    </script>
    as you have done, directly on the ASPX page and leave only:
    <%@ Page Language="vb" %>
    in the Page directive.

    It will allow us to just copy, paste and run. Here are the good tips regarding posting the examples of the forums.
    Forum Guidelines For Posting New Topics

    Also I was unable to run your code due to the fact that it depends on the database. It would be best to replace this dependence with some dummy data.
  3. #3

    Re: Paging issues with combobox

    Hi Daniil,

    Thank you very much for the fix. It works great now.

    I will follow the guidelines as advised in future.

    Thanks

    Ravi Swaminathan

Similar Threads

  1. [CLOSED] [1.0] Status bar for combobox that does not use paging
    By betamax in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 11, 2010, 7:38 PM
  2. Custom paging in grid has issues
    By getgopi1 in forum 1.x Help
    Replies: 8
    Last Post: Sep 22, 2010, 1:55 PM
  3. [CLOSED] combobox with paging
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 05, 2010, 7:24 PM
  4. [CLOSED] [0.8.2] ComboBox rendered issues
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 18, 2010, 2:34 PM
  5. [CLOSED] Issues setting ComboBox selected items
    By dlouwers in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 14, 2009, 12:07 PM

Posting Permissions