开发者

Using TextboxList events and callbacks

开发者 https://www.devze.com 2022-12-30 04:45 出处:网络
Has anyone gotten callbacks working with Guillermo Rauch\'s TextboxList Autocomplete? I\'ve tried multiple ways to bind and multiple events (e.g. hover) - nothing seems to register.

Has anyone gotten callbacks working with Guillermo Rauch's TextboxList Autocomplete? I've tried multiple ways to bind and multiple events (e.g. hover) - nothing seems to register.

$('#entSearch').textboxlist({unique: true, plugins: {
            autocomplete: {
                minLength: 3,
                queryRemote: true, 
                placeh开发者_StackOverflow社区older: 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');
        });


The author enabled listeners in a very specific way for TextboxList (see "Events" on 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');
        });
0

精彩评论

暂无评论...
验证码 换一张
取 消