生成具有相同类父子选择的复选框树

问题描述 投票:0回答:2
javascript jquery checkbox
2个回答
1
投票

你可以的,

$('.level_').change(function() {
  $(this).nextUntil(".level_").prop('checked', this.checked);
});

小提琴

  • 不要使用硬编码的父名称,只需使用
    this
    (当前对象)即可。
  • 然后使用
    nextUntil(next parent selector)
    选择当前元素之后和下一个父元素之前的所有子元素。

0
投票

/*

命名空间 Zoho_HybridFramework { 公共类 ExtentManager { 公共静态 ExtentHtmlReporter htmlReporter;

    private static ExtentReports extent;

    private ExtentManager()
    {

    }

    public static ExtentReports getInstance()
    {
        if (extent == null)
        {
            string reportFile = DateTime.Now.ToString().Replace("/", "_").Replace(":", "_").Replace(" ", "_") + ".html";

            htmlReporter = new ExtentHtmlReporter(Constants.REPORT_PATH + reportFile);
            extent = new ExtentReports();
            extent.AttachReporter(htmlReporter);
            extent.AddSystemInfo("OS", "Windows");
            extent.AddSystemInfo("Host Name", "Gunjan");
            extent.AddSystemInfo("Environment", "QA");
            extent.AddSystemInfo("UserName", "Gunjan");

            string filePath = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory);
            filePath = Directory.GetParent(Directory.GetParent(filePath).FullName).FullName;

            htmlReporter.LoadConfig(filePath + "\\util\\extent-config.xml");
        }
        return extent;
    }
}

}*/

我尝试使用 id 和 name,所以我尝试使用此代码来识别屏幕上的元素,并创建一个测试报告。 dll 不工作。

希望应用程序可扩展,即能够添加实现新命令的新模块,而无需更改主应用程序源。这棵树看起来像:

希望应用程序可扩展,即能够添加实现新命令的新模块,而无需更改主应用程序源。这棵树看起来像:

希望应用程序可扩展,即能够添加实现新命令的新模块,而无需更改主应用程序源。这棵树看起来像:

© www.soinside.com 2019 - 2024. All rights reserved.