2011-01-26 02:08
浏览 67

试图在cakephp视图中使用yui treeview

I'd like to put a yui treeview inside of an add.ctp view in a cakephp application. I've got the treeview displaying fine but I'm trying to get a handle on how I can incorporate the treeview selected nodes with the post data that gets submitted by the cakephp view.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongxuan1660 2011-01-26 19:23

    I solved the same problem using JSON:

    1. Create a JavaScript function that allow encoding of the YUI's selected nodes into a JSON string
    2. Add the JSON string to a hidden field with the DOM properties
    点赞 打赏 评论
  • dongzun9958 2011-01-27 18:20

    Yes - I think that is essentially what I did. I added an onsubmit() function that would grab the values from the treeview using treeview.getNodesByProperty() and then would populate a hidden control in the form.

    点赞 打赏 评论

相关推荐 更多相似问题