2
A
回答
2
下面是自动填充和Ajax的例子:
/*Create a ValueCell to update*/
val cell = ValueCell("")
/* Do a basic ajaxText */
val nameAjax = SHtml.ajaxText(cell.get, s=>{ cell.set(s); Noop})
/* Make attributes out of it */
val attrs: Seq[(String,String)] = nameAjax.attributes.toList.map{md => (md.key,md.value.text)}
/* Do the basic autocomplete with your attibutes */
def query(s:String):List[String] /*Do the query to get the desired autocomplete values */
def buildQueryName(current: String, limit: Int): Seq[String] = {
if (current.length == 0) Nil
else query(current).take(limit) /*query representing
}
private def processResult(s : String) {}
/* Function to render the autocomplete box */
def autoCompleteBox = AutoComplete("", buildQueryName _, processResult _ , attrs:_*)
/* function to render the dynamic part */
def dynamicPart = WiringUI.apply(cell)(createDynamicPart)
def createDynamicPart(value:String)(ns:NodeSeq):NodeSeq ={
<h3> value selected: {value} </h3>
}
相关问题
- 1. AJAX更改页面内容
- 2. javascript,更改页面内容
- 3. 更改Eclipse自动完成(内容辅助)的行为
- 4. 更改jQuery自动完成
- 5. 插入其他页面的内容,使用电梯
- 6. 使用jquery更改页面内容时停止滚动页面
- 7. 电梯 - 使用Ajax提交自动完成
- 8. 更新页面内容更改指针
- 9. 自定义Algolia自动完成页脚内容(Magento2)
- 10. jQuery自动完成显示Html内容
- 11. 完成更改并在网页中添加内容
- 12. 如何更改HTML内容,当页面完全加载
- 13. 如何在我的内容脚本完成DOM更改之前隐藏页面?
- 14. 分离自动完成jQuery页面
- 15. jsp页面中的自动完成
- 16. Django ComboField更改页面内容
- 17. 更改页面的内容标题
- 18. 更改内容概述页面
- 19. 使用Angular更改页面内容
- 20. Htaccess更改页面的内容类型?
- 21. 在动画完成前更改CALayer内容
- 22. Jquery UI自动完成事件更改
- 23. JQuery自动完成提交更改
- 24. 自动完成后更改事件
- 25. Primefaces自动完成更改分隔符
- 26. 更改Emmet的自动完成
- 27. 更改自动完成键绑定
- 28. jQuery自动完成和更改交互
- 29. 更改图像src jQuery自动完成
- 30. JQuery的自动完成更改事件