Jun 20, 2012, 10:12 PM
[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?
Thanks
Ravi Swaminathan
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]