提前取消取消定义错误

时间:2018-10-08 08:45:15

标签: jquery typeahead

在预输入中,触发 onCancel 事件时,该事件始终返回“未定义”。请帮助我解决问题。

$.typeahead({
           input: "#recipient_notification1",
           minLength: 1, maxItem: 15, order: "asc", hint: true,
           group: {template: "@{{group}} Fields!"},
           maxItemPerGroup: 3,
           dropdownFilter: "select",        display: "value",        
           emptyTemplate: 'No result for "@{{query}}"',
           source: {
               user: {ajax: {url: "getApproverFields",path: "user"}},
               individual: {ajax: {url: "getApproverFields",path: "individual"}},
           },       multiselect: {limit: 5,},        
           callback: {
               onClickAfter: function (node, a, item1, event) {
                   conval1.push(item1.group.toLowerCase()+"."+item1.name);      
                   $('#approverlist1').val(conval1);
               },
               onCancel: function (node, item1, event) {
                   console.log(item1);
                   alert(item1.name + ' Removed!');
               }        
           },
           debug: true
        });

如果触发了oncancel事件,它将返回“未定义的已删除”。我该如何解决。请帮助

0 个答案:

没有答案