I was happy when it worked.
But this works only in non paged listing.
(sorry, but was not in the example)
For example:
Total records = 100,
First page:
{total:100,'items':[ {'Id':10,'Nazev':'xxxx1'},{'Id':11,'Nazev':'xxxx2'},{'Id':12,'Nazev':'xxxx3'},{'Id':13,'Nazev':'xxxx4'}] }
Second page:
{total:100,'items':[ {'Id':14,'Nazev':'xxxx4'},{'Id':15,'Nazev':'xxxx5'},{'Id':16,'Nazev':'xxxx6'},{'Id':17,'Nazev':'xxxx7'}] }
If I select field from first page, its OK:
this.ComboBox1.SelectedItems.Add(new Ext.Net.ListItem() { Value = "10", Mode = Ext.Net.ParameterMode.Raw });
but, I select field from second (and others) page its wrong:
this.ComboBox1.SelectedItems.Add(new Ext.Net.ListItem() { Value = "14", Mode = Ext.Net.ParameterMode.Raw });
This sample is here:
http://www.dno.cz/WebSite1.v2.zip
<ext:Store ID="Store1" runat="server" AutoLoad="true">
<Proxy>
<ext:AjaxProxy Url="Handler.ashx">
<ActionMethods Read="POST">
</ActionMethods>
<Reader>
<ext:JsonReader Root="items" TotalProperty="total">
</ext:JsonReader>
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Id" Type="Int" />
<ext:ModelField Name="Nazev" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:ComboBox ID="ComboBox1" ColSpan="5" runat="server"
StoreID="Store1" DisplayField="Nazev" ValueField="Id" QueryMode="Remote" AutoSelect="true" PageSize="4">
<ListConfig LoadingText="Searching..." MinWidth="300" Border="true"></ListConfig>
<Listeners>
</Listeners>
</ext:ComboBox>
Test handler code:
if (context.Request.Params["page"] != null && int.Parse(context.Request.Params["page"]) > 1)
{
context.Response.Write("{total:100,'items':[ {'Id':14,'Nazev':'xxxx4'},{'Id':15,'Nazev':'xxxx5'},{'Id':16,'Nazev':'xxxx6'},{'Id':17,'Nazev':'xxxx7'}] }");
}
else
{
context.Response.Write("{total:100,'items':[ {'Id':10,'Nazev':'xxxx1'},{'Id':11,'Nazev':'xxxx2'},{'Id':12,'Nazev':'xxxx3'},{'Id':13,'Nazev':'xxxx4'}] }");
}