PDA

View Full Version : Set a Text value into AutoComplete Combo box problem when upgrade from v2.5 to 4.0.0



odaysaed
Apr 14, 2016, 7:30 AM
Hello everyone,
I make an auto-complete comboBox and bind data into its store via .ashx ajax proxy.
now the combobox works fine but when I set a text value into it , this will return an empty text.

this code was worked in ext.net v2.5,but after upgrade to 4.0.0 the empty text happened.

to return data via ashx..


<ext:ComboBox ID="CobMemberSearch" runat="server"
DisplayField="Name"
ValueField="BarCode"
TypeAhead="false"
HideTrigger="true"
MinChars="0"
TriggerAction="Query" Width="350" LabelWidth="100" FieldLabel="Member Name" Icon="UserMagnify" >
<ListConfig LoadingText="searching ...">
</ListConfig>
<Store>
<ext:Store ID="Store3" runat="server" AutoLoad="false">
<Proxy>
<ext:AjaxProxy Url="~/Search/Search.ashx">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader RootProperty="root" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Parameters>
<ext:StoreParameter Name="ID" Value="#{txtId}.getValue()" Mode="Raw" />
</Parameters>
<Model>
<ext:Model ID="Model26" runat="server" IDProperty="BarCode">
<Fields>
<ext:ModelField Name="memBarCode" Mapping="BarCode" />
<ext:ModelField Name="memName" Mapping="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>

<DirectEvents>
<Select OnEvent="SearchMember" />
</DirectEvents>

</ext:ComboBox>

the above code works fine and return data

now i want to set a text into comboBox manually, i tried these two lines, it keeps returning an empty combo


CobMemberSearch.Select("Derp");
CobMemberSearch.Text = "Herp";

fabricio.murta
Apr 14, 2016, 11:30 PM
Hello @odaysaed! Welcome to Ext.NET forums!

I get it that you are trying to programatically select an entry in the combo box from code behind, right?

Just in case, if you are trying to select the combobox from a JavaScript code, the code you would be using would be:


App.CobMemberSearch.select('Derp');


Now, from code behind, it depends on how are you triggering the event that tries to select the combo box. Can you provide a full sample reproducing the scenario where you need to select the combo box? Are you sure the scenario depends on a combo box that is filled thru an ASHX page (maybe just a simple combo box with static data is enough to demonstrate the issue you are having, and letting you make a simpler example focusing on the actual issue!)..

Please take your time to review our guidelines on posting questions and coming up with simple, runnable examples:
- Forum Guidelines For Posting New Topics (http://forums.ext.net/showthread.php?3440)
- More information required (http://forums.ext.net/showthread.php?10205)

Actually, this can prove very useful as sometimes when trying to put together a simples example we end up either clarifying what the real problem is or finding the fix to the problem itself!

Hope this helps!

odaysaed
Apr 15, 2016, 12:36 AM
Hi, Thank you for your reply.
I will try to describe my case
first: I used comboBox as autoComplete box so there is no dropdownlist and that works fine
notice that it has a propriety

HideTrigger="true"

then: I want to insert or bind a text to this comboBox,any text value its not required to be a data from .asxh (this is not working)

comboBox.text = "foo";
comboBox.value = "moo";
ComboBox.select("hoo");

notice that was working in ext.net v2.5