ich keinen Zugriff auf die Back-End-Komponenten, aber die Demo Sie enthält Code-Frontend verknüpft haben und es sieht aus wie du da drin hacken. Es sieht so aus, als ob dieses Steuerelement nur Client-Server- und Client-Seite sein kann. Für Client-Seite sieht nur Hacks etwas kompliziert aus und verwendet nicht-öffentliche API (_onInputChange
), aber für Client-Server-Fall (was wahrscheinlich Ihr Fall ist) erwähnt das Dokument client side of RadComboBox ObjectrequestItems
Methode so Hacking ist wahrscheinlich einigermaßen zukunftssicher:
var hackRadComboBoxFilter = function (combobox, filterProcessingFunction) {
var oldRequestItems = combobox.requestItems;
combobox.requestItems = function() {
var args = Array.prototype.slice.call(arguments);
// requestItems has several arguments but the text seems to be the
// first one, so let's modify it and call the original method
var origFilter = args[0];
args[0] = filterProcessingFunction(origFilter);
oldRequestItems.apply(this, args);
}
};
Leider weiß ich nicht über eine integrierte Methode, mit Akzenten in JS beschäftigen, aber Sie können auch etwas einfach hier hack:
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var mappedAccents = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
var removeAccents = function (origStr) {
var components = [];
var len = origStr.length;
var afterLastAccent = 0;
for (var i = 0; i < len; i++) {
var mapPos = accents.indexOf(origStr[i]);
if (mapPos != -1) {
components.push(origStr.substr(afterLastAccent, i - afterLastAccent) + mappedAccents[mapPos]);
afterLastAccent = i + 1;
}
}
if (afterLastAccent < len)
components.push(origStr.substr(afterLastAccent, len - afterLastAccent));
return components.join('');
};
so, jetzt können Sie es in etwas kombinieren wie dies:
// In real app you probably want something like this
// var targetComboBox = $find("<%= RadComboBox1.ClientID %>");
// but for test let's just hack first combobox on the page
var targetComboBox = Telerik.Web.UI.RadComboBox.ComboBoxes[0];
hackRadComboBoxFilter(targetComboBox, removeAccents);
oder wenn Sie alle Comboboxen auf der Seite ändern möchten, können Sie Prototyp mit dem gleichen Trick ändern:
hackRadComboBoxFilter(Telerik.Web.UI.RadComboBox.prototype, removeAccents)