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的自動完成更改事件