Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Acentos en TextboxList.Autocomplete.Methods

Estas en el tema de Acentos en TextboxList.Autocomplete.Methods en el foro de Frameworks JS en Foros del Web. Hola a todos. Soy nuevo en esto, y por lo tanto os pido ayuda. El problema que tengo es en una busqueda. $.TextboxList.Autocomplete.Methods = { ...
  #1 (permalink)  
Antiguo 09/10/2013, 01:02
 
Fecha de Ingreso: octubre-2013
Mensajes: 3
Antigüedad: 10 años, 6 meses
Puntos: 0
Acentos en TextboxList.Autocomplete.Methods

Hola a todos.
Soy nuevo en esto, y por lo tanto os pido ayuda.
El problema que tengo es en una busqueda.
$.TextboxList.Autocomplete.Methods = {

standard: {
filter: function(values, search, insensitive, max){
var newvals = [], regexp = new RegExp('\\b' + escapeRegExp(search), insensitive ? 'i' : '');
for (var i = 0; i < values.length; i++){
if (newvals.length === max) break;
if (regexp.test(values[i][1])) newvals.push(values[i]);

}
return newvals;


},

highlight: function(element, search, insensitive, klass){
var regex = new RegExp('(<[^>]*>)|(\\b'+ escapeRegExp(search) +')', insensitive ? 'ig' : 'g');
return element.html(element.html().replace(regex, function(a, b, c){
return (a.charAt(0) == '<') ? a : '<strong class="'+ klass +'">' + c + '</strong>';
}));
}
}

};

var chk = function(v){ return !!(v || v === 0); };
var escapeRegExp = function(str){ return str.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); };

Y quisiera añadir estos caracteres a la búsqueda
function accent_fold (s) {
if (!s) { return ''; }
var accentMap = {'á':'a','é':'e','í':'i','ó':'o','ú':'u','Á':'A',' É':'E','Í':'I','Ó':'O','Ú':'U','ñ':'n','Ñ':'N'};
var ret = '';
for (var i = 0; i < s.length; i++) {
ret += accentMap[s.charAt(i)] || s.charAt(i);
}
return ret;
};

Os estaría muy agradecidos.
Gracias.
  #2 (permalink)  
Antiguo 09/10/2013, 11:23
 
Fecha de Ingreso: octubre-2013
Mensajes: 3
Antigüedad: 10 años, 6 meses
Puntos: 0
Exclamación Respuesta: Acentos en TextboxList.Autocomplete.Methods

Por Favor, ayuda.
Gracias
  #3 (permalink)  
Antiguo 11/10/2013, 09:11
 
Fecha de Ingreso: octubre-2013
Mensajes: 3
Antigüedad: 10 años, 6 meses
Puntos: 0
Respuesta: Acentos en TextboxList.Autocomplete.Methods

No hay nadie que me pueda ayudar?

Etiquetas: acentos, html, javascript
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:49.