【问题标题】:jExpand not for the whole table; just for some linesj不要为整个表展开;只是为了一些线
【发布时间】:2017-12-03 22:39:29
【问题描述】:

我正在尝试将 jExpand (http://www.jankoatwarpspeed.com/expand-table-rows-with-jquery-jexpand-plugin/) 仅用于表格的某些行,而不是每一行!

您可以在演示链接上查看:

http://www.jankoatwarpspeed.com/wp-content/uploads/examples/expandable-rows/

您可以展开每一行(每个国家)以获取更多信息。

在我的情况下,我想只扩展一些行而不是每一行。

例如,我想让“United Kingdom”和“India”行扩展。

我需要怎么做?

我试图删除div class="arrow"></div>,但我们仍然可以扩展该行:/

【问题讨论】:

    标签: jquery html html-table expand


    【解决方案1】:

    class 添加到您不想展开的行并在脚本中忽略它们。
    在我的示例中,我添加了 .nope 类。

    $("#report tr:odd:not(.nope)").addClass("master");
    $("#report tr:not(.master, .nope)").hide();
    $("#report tr:first-child").show();
    $("#report tr.master").click(function(){
        $(this).next("tr").toggle();
        $(this).find(".arrow").toggleClass("up");
    }); 
    

    TEST IT HERE

    【讨论】:

    • 完美!多谢,伙计 ! :)
    【解决方案2】:

    尝试从您不想扩展的行中删除“奇数”类。 框架可能会使用该名称进行处理。如果框架是将该类归因于行的框架,那么您需要检查框架选项...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多