PDA

View Full Version : [CLOSED] [#537] Combobox Case Insensitive Value Matching



pgodwin
Sep 03, 2014, 2:39 AM
Hi there

Is it possible to have the Combobox not be case sensitive when matching values to those in the store?

For example, the Combobox value is set to "Mr" but the value in the store is "MR", the combo will not select the appropriate record. I'd like it to match Mr and MR, if possible.

Cheers

Peter

Daniil
Sep 03, 2014, 5:31 AM
Hi Peter,

There is an example.
http://forums.ext.net/showthread.php?20403&p=104753&viewfull=1#post104753

pgodwin
Sep 03, 2014, 11:39 PM
Thanks Daniil.

You can close the thread, but is there any plans to bring the caseSensitive config option from 4.2.2 to Ext.net?

Cheers

Peter

Daniil
Sep 04, 2014, 4:42 AM
The property has appeared in ExtJS 4.2.1, so, we can add it. Thank you for pointing that out.

Though, it is false by default and it actually works. If type "item", it shows all the items. So, it is case insensitive. It should also work like that on your page unless you use some old version of Ext.NET v2.

Example

<%@ Page Language="C#" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.ComboBox1.GetStore();
store.DataSource = new object[]
{
new object[] { "1", "Item 1" },
new object[] { "2", "Item 2" },
new object[] { "3", "Item 3" }
};
}
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:ComboBox
ID="ComboBox1"
runat="server"
DisplayField="text"
ValueField="value"
QueryMode="Local">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="value" />
<ext:ModelField Name="text" />
</Fields>
</ext:Model>
</Model>
<Reader>
<ext:ArrayReader />
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
</form>
</body>
</html>


Anyway, I've created an Issue for missing CaseSensitive property.
https://github.com/extnet/Ext.NET/issues/537

The property has been added in the SVN trunk in the revision #5950.