0

有没有人使用 Guillermo Rauch 的TextboxList Autocomplete获得回调?我尝试了多种绑定方式和多个事件(例如hover) - 似乎没有任何注册。

$('#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');
        });
4

1 回答 1

1

作者以非常特定的方式为 TextboxList 启用了侦听器(请参阅此页面上的“事件” ):

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');
        });
于 2010-05-18T02:37:59.600 回答