Nov 10, 2010, 9:34 AM
Problem with paging in combo box
Hi. I am new to Ext.net
I am integrating combo box in grid
Waiting for your help!
Thanks in advance
I am integrating combo box in grid
var SupplierRenderer = function(value) {
var r = dsSupplier.getById(value);
if (Ext.isEmpty(r)) {
return "";
}
return r.data.SupplierName;
};
...
<ext:GridPanel>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column DataIndex="supplierid" Header="Supplier" Width="150">
<Renderer Fn="SupplierRenderer" />
<Editor>
<ext:ComboBox ID="Suppliercombo" runat="server"
Mode="Local"
TriggerAction="All"
ForceSelection="true"
StoreID="dsSupplier"
ValueField="sid"
DisplayField="SupplierName"
MinChars="1"
ListWidth="300"
PageSize="15"
ItemSelector="tr.list-item"
TypeAhead="true">
<Template ID="Template2" runat="server">
<Html>
<tpl for=".">
<tpl if="[xindex] == 1">
<table class="txtCustomers-list">
<tr>
<th>Supplier</th>
<th>Description</th>
</tr>
</tpl>
<tr class="list-item">
<td style="padding:3px 0px;">{SupplierName}</td>
<td>{Description}</td>
</tr>
<tpl if="[xcount-xindex]==0">
</table>
</tpl>
</tpl>
</Html>
</Template>
</ext:ComboBox>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
...
Here is my store <ext:Store ID="dsSupplier" runat="server">
<Proxy>
<ext:HttpProxy Url="/Supplier/GetSuppliers/" />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="sid" Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="sid" />
<ext:RecordField Name="SupplierName" SortDir="ASC"/>
<ext:RecordField Name="Description" />
</Fields>
</ext:JsonReader>
</Reader>
<BaseParams>
<ext:Parameter Name="limit" Value="15" Mode="Raw" />
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="dir" Value="ASC" />
<ext:Parameter Name="sort" Value="sid" />
</BaseParams>
<SortInfo Field="sid" Direction="ASC" />
</ext:Store>
according to my code, my combo box will be paged with 15 records each page, GetSupplier function from my controller ( i am using asp.net mvc) will return first 15 records from table Supplier. And the problem is when my supplierid is 25th record, the combo box Suppliercombo can not find the real SupplierName of it because it is looking only in the first 15 records. Therefore, it returns supplierid instead of SupplierName. If supplierid is in the first 15 records, it works fine as i expected.Waiting for your help!
Thanks in advance
Last edited by t2kien; Nov 10, 2010 at 1:51 PM.