I have a few problems with combobox based upon: combobox/serverfiltering.html;
First one is related to lower/higher case of characters i'm typing. While the server does return appropriate results the dropdown does not appear to trigger (so the results . If I trigger it manually in code it immediately closes back. I've tried using ignoreCase and altering it between true and false but it apparently doesn't matter :/
The second problem is that if I remove the focus from the combobox and return to it later on I cannot seem to be able to delete the input content or open the dropdown via button, especially if I've typed a character combination upon server doesn't return results.
Any help or hints would be greatly appreciated. I also provided the full source code of the problematic code.
First one is related to lower/higher case of characters i'm typing. While the server does return appropriate results the dropdown does not appear to trigger (so the results . If I trigger it manually in code it immediately closes back. I've tried using ignoreCase and altering it between true and false but it apparently doesn't matter :/
The second problem is that if I remove the focus from the combobox and return to it later on I cannot seem to be able to delete the input content or open the dropdown via button, especially if I've typed a character combination upon server doesn't return results.
Any help or hints would be greatly appreciated. I also provided the full source code of the problematic code.
01.
var
_ds =
new
kendo.data.DataSource({
02.
serverfiltering:
true
,
03.
transport: {
04.
read: {
05.
url:
"ashx/Main/GetAvailableOUs.ashx"
,
06.
dataType:
"json"
,
07.
data: { searchSTR: searchSTR_ }
08.
}
09.
},
10.
schema: {
11.
model: {
12.
id:
"text"
,
13.
fields: {
14.
value: { from:
"OUid"
, type:
"number"
},
15.
text: { from:
"OU"
, type:
"text"
},
16.
Img: { from:
"Img"
, type:
"text"
},
17.
isActive: { from:
"IsActive"
, type:
"number"
}
18.
}
19.
}
20.
}
21.
});
22.
23.
$(
"#OUSelector"
).kendoComboBox({
24.
dataTextField:
"text"
,
25.
dataValueField:
"value"
,
26.
dataSource: _ds,
27.
minLength:3,
28.
ignoreCase:
false
,
29.
autoBind:
false
,
30.
highlightFirst:
false
,
31.
change:
function
(e) {
32.
_ds.options.transport.read.data = { searchSTR: e.sender._selectedValue };
33.
_ds.read();
34.
},
35.
filter:
"contains"
,
36.
template:
'# if (Img == "") '
+
37.
'{# <span id="#: value #" style="display:block;margin:-1px -5px -2px -5px;padding:0 5px; # if (isActive == 0) {# background:red;color:white; #}#">#: text #</span> #}'
+
38.
'else'
+
39.
'{# <span id="#: value #" style="display:block;margin:-1px -5px -6px -5px;padding:0 5px; # if (isActive == 0) {# background:red;color:white; #}#"><img src="/img/#: Img #.png" alt="#: text #" />#: text #</span> #}#'
,
40.
select:
function
(e) {
41.
kMain.fn_logon_to_company($(e.item[0]).children(
"span"
).attr(
'id'
));
42.
}
43.
});
44.
45.
$(
".OUSelectorContainer .k-input"
).on(
'keydown'
,
function
(e) {
46.
e.sender = { _selectedValue: e.currentTarget.value };
47.
var
ouselect_ = $(
"#OUSelector"
).data(
"kendoComboBox"
);
48.
49.
ouselect_.options.change(e);
50.
});