Apr 18, 2012, 12:03 PM
[CLOSED] autocomplete ä la "Custom search example"
Hi
i am trying to achieve the autocomplete functionality with the custom search example. But instead of using the Httphandler I am using a web service (.asmx) method.
I changed the example in this way:
response (fiddler raw):
i am trying to achieve the autocomplete functionality with the custom search example. But instead of using the Httphandler I am using a web service (.asmx) method.
I changed the example in this way:
<div style="width:600px;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Search the plants</h3>
<ext:ComboBox
runat="server"
DisplayField="Common"
ValueField="Common"
TypeAhead="false"
LoadingText="Searching..."
Width="570"
PageSize="10"
HideTrigger="true"
ItemSelector="div.search-item"
MinChars="1">
<Store>
<ext:Store runat="server" AutoLoad="false">
<Proxy>
<ext:HttpProxy Method="Post" Url="WebServiceTest.asmx/Data" />
</Proxy>
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="Common"/>
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<Template runat="server">
<Html>
<tpl for=".">
<div class="search-item">
<h3>{Common}</h3>
</div>
</tpl>
</Html>
</Template>
</ext:ComboBox>
<div style="padding-top:4px;">
Plants search (type '*' (asterisk) for showing all)
</div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
And the web service looks like this:[WebMethod]
public string[] Data(string query)
{
var strArr = new string[] { "one", "two", "three" };
return strArr.Select(x => query + " " + x).ToArray();
}
Everything looks fine the web service is called and the string array is returned see the response. But there is a request failure by Ext.net. Can someone please help?response (fiddler raw):
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<string>b one</string>
<string>b two</string>
<string>b three</string>
</ArrayOfString>
Last edited by Daniil; Apr 19, 2012 at 9:36 AM.
Reason: [CLOSED]