我正在使用codemirror编辑器...当我进行自动完成时我需要我从下拉列表中选择项目来处理(获取)所选的值...可以帮助我吗?
答案 0 :(得分:2)
您是否尝试对所选项目执行某些操作?如果是这样,您应该收听pick
对象上的completion
事件。你可以这样做:
...
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。