0

I am trying to implement a chained select dependent on 2 parent selects, but the child select always remains disabled, with no options loading. As far as I can tell, the first-parent\second-parent format is correct in my data, but yet the child select won't fire.

My setup is as follows:

  • 1st parent select: years (year-2016, year-2015, year-2014...)
  • 2nd parent select: media types (article, gallery, video)

If "year-2015" and "article" are selected, then the child select should display options with the class "year-2015\article".

Scripts:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="jquery.chained.js"></script>
<script>$("#item").chained("#year, #mediatypes");</script>

Here is a jsfiddle with the generated HTML

My code seems to be consistent with this example fiddle -- but I can't identify why my child select won't fire. What am I missing?

4

1 回答 1

0

我在花时间发布此消息后不久就发现了问题...

我把课程的顺序弄错了。我的孩子选择格式为“year-2015\article”而不是“article\year-2015”的所需课程。简单的错误,但我正在“回答”我的问题,以防其他人犯同样的错误。

于 2016-05-20T23:13:20.130 回答