【问题标题】:Using TextboxList events and callbacks使用 TextboxList 事件和回调
【发布时间】:2010-05-10 01:21:13
【问题描述】:

有没有人在使用 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');
        });

【问题讨论】:

    标签: jquery jquery-plugins callback jquery-callback textboxlist


    【解决方案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');
            });
    

    【讨论】:

      猜你喜欢
      • 2015-10-29
      • 1970-01-01
      • 1970-01-01
      • 2011-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      相关资源
      最近更新 更多