2010-05-10 68 views
0

有沒有人得到與Guillermo Rauch的TextboxList Autocomplete工作的回調?我嘗試了多種綁定方式和多個事件(例如懸停) - 似乎沒有任何註冊。使用TextboxList事件和回調

$('#entSearch').textboxlist({unique: true, plugins: { 
      autocomplete: { 
       minLength: 3, 
       queryRemote: true, 
       placeholder: false, 
       remote: { 
        url: "{{=URL(r=request, f='call/json/suggest')}}", 
        extraParams: {type: "", guid: ""} 
        } 
       } 
      }, 
      onHover: function(token) { 
       alert('hover 1'); 
      } 
     }); 

     $('#entSearch').hover(function() { 
      alert('hover 2'); 
     }); 

     $('#entSearch').bind('hover', function() { 
      alert('hover 3'); 
     }); 

回答

1

筆者啓用聽衆在TextboxList一個非常特殊的方式(見this page 「事件」):

var t = new $.TextboxList('#entSearch', {unique: true, plugins: { 
      autocomplete: { 
       minLength: 3, 
       queryRemote: true, 
       placeholder: false, 
       remote: { 
        url: "{{=URL(r=request, f='call/json/suggest')}}", 
        extraParams: {type: "", guid: ""} 
        } 
       } 
      } 
     }); 

     t.addEvent('bitBoxAdd', function(bit) { 
      alert('add'); 
     });