doulu4233
doulu4233
2015-04-08 09:03

如何使用golang的模板实现级联下拉菜单

  • html
  • ajax
  • javascript
  • jquery

Scenario:

I have a cascade scenario, where values in second dropdown depends upon first. I have three templates "layout", "input" and "inner".

Attempt:

I'm making ajax call on change of first dropdown in "input" template and stuck with handling the response returned. Currently I found a way to fix it by replacing html of second dropdown. But, I think this is not the better way to handle. I want something in line of rendering templates where I do not need to amend html.

please help in acheiving the task in better way or point to some wiki. Only Standard Library

Thanks,

Layout.html: http://play.golang.org/p/LikKy6rf3-

Input.html: http://play.golang.org/p/wM7EpPdXuM

Inner.html: http://play.golang.org/p/xFpInKZfFT

Main.go: http://play.golang.org/p/cxtJU-Lhi1

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐