2016-09-25 47 views

回答

1

您是否在尝试使用选定的项目进行操作?如果是这样,您应该听completion对象上的pick事件。你可以通过这个做到这一点:

... 
var completion = {list: someHintList, from: somePos, to: somePos}; 
CodeMirror.on(completion, "pick", function(selectedItem) { 
    // Do something with the selectedItem. 
    // This function would be called after user pick a item from the list. 
} 
return completion; 

欲了解更多信息,请查看document about hint addon

+0

感谢您的回答...我正在使用onselect,它的工作原理 – sara