Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问题记录 #106

Open
popomore opened this issue Oct 20, 2014 · 3 comments
Open

问题记录 #106

popomore opened this issue Oct 20, 2014 · 3 comments

Comments

@popomore
Copy link
Member

  1. 当 dataSource 是 url 时,貌似 input 中每次 change 都会发一次 ajax 请求,有办法能延迟请求么?
  2. 高亮匹配值无效
  3. 能否在不改源码情况下定义 suggestion 区域与 input 的距离
  4. 如何回车拿到选中参数并跳转新页面
@popomore
Copy link
Member Author

  1. 现在的实现方案是监听键盘事件而非轮训,所以延迟很难做到,因为很难判断某次变化是否需要发送,如果需要定制可以把 dataSource 设为 function 自己处理
  2. http://aralejs.org/autocomplete/examples/#高亮匹配值 使用这个无效么
  3. 继承自 overlay,可以看 align 参数 http://aralejs.org/overlay/#align-object
  4. 可以把 input 放在 form 中,回车出发 submit 发送 get 请求

@afc163
Copy link
Member

afc163 commented Oct 21, 2014

  1. 总是延迟如何?
var timeout;
.on('change', function() {
  if (timeout) {
    clearTimeout(timeout);
  }
  timeout = setTimeout(function() {
    // do xhr
  }, delay);
});

@piaer
Copy link

piaer commented Jul 14, 2015

arale 能改为amd的吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants