1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
dojo.addOnLoad(
function()
{
dijit.byId('searchPlans').attr('searchAttr', null);
canSearch = false;
dijit.byId('searchPlans').autoComplete = false;
dojo.connect(dojo.byId('searchPlans'), 'onkeyup', myAutocomplete);
}
);
function myAutocomplete()
{
if(dojo.byId('searchPlans').value.length > 3 && canSearch == false)
{
//start autocomplete
//alert(dijit.byId('searchPlans').autoComplete);
//alert(dijit.byId('searchPlans').attr('store'));
dijit.byId('searchPlans').attr('searchAttr', 'my_field'); //champs sur lequel s'effectue la recheche
canSearch = true;
console.info('OK - ' + canSearch);
}
else if(dojo.byId('searchPlans').value.length == 3 && canSearch == true)
{
//stop autocomplete
dijit.byId('searchPlans').attr('searchAttr', null);
canSearch = false;
console.info('KO - ' + canSearch);
}
} |
Partager