اصلاح و یا تغییر متن جستجو در select2 ( Select2 Matcher )
function matchStart (term, text) { if (term.term) { var searchText = persianJs(term.term.toUpperCase()).arabicChar().toString(); var itemText = persianJs(text.text.toUpperCase()).arabicChar().toString(); if (itemText.indexOf(searchText) >= 0) { return text; } } return false; } $('#<%=ddlDescriptionSend.ClientId %>').select2({ dir: "rtl", escapeMarkup: function(m) { // Do not escape HTML in the select options text return persianJs(m).arabicChar().toString(); }, matcher : matchStart });